Btw,

I read about django don't accept @ in usernames, but I can create a User
using
User.create_user(m...@email.com, m...@email.com, mypassword)
The only problem is, I can't save the user at admin site.
I was thinking if the limitation is only at forms.
I did not test the authentication yet.
Any one know more about this ?

Thanks
ps - sorry my poor english.
Cheers

On Sun, May 2, 2010 at 7:54 AM, Rob <rob.nikan...@gmail.com> wrote:

> Hi,
>
> I'm trying to allow usernames that have '@' in them, so they can just
> be email addresses.  Maybe this is a bad idea.  ...  But putting that
> aside for a second... The admin user forms don't validate with '@' in
> usernames, so I thought I'd try this, which I copied from an older
> post in this group.
>
> from django.contrib.auth.admin import User, UserChangeForm,
> UserCreationForm, UserAdmin
>
> class OurUserChangeForm(UserChangeForm):
>    username = forms.EmailField
>
> class OurUserCreationForm(UserCreationForm):
>    username = forms.EmailField
>
> admin.site.unregister(User)
> UserAdmin.form = OurUserChangeForm
> UserAdmin.add_form = OurUserCreationForm
> admin.site.register(User, UserAdmin)
>
> But it doesn't work.  The user form is still validating with the
> 'username' from the superclass, which is a RegexField.  Is this
> working as designed?  Are you not allowed to override a field?
>
> thanks,
> Rob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to