On Wed, Feb 1, 2017 at 5:32 AM, wrote:
> You can define a single form to use for creating and updating users like
> this:
>
> class CustomUserChangeForm(UserChangeForm):
> class Meta:
>
>
> model = User
>
>
> fields = ('email', 'password', 'first_name', 'last_name',
You can define a single form to use for creating and updating users like
this:
class CustomUserChangeForm(UserChangeForm):
class Meta:
model = User
fields = ('email', 'password', 'first_name', 'last_name', 'photo',
'is_active', 'is_staff', 'user_permissions')
class
I want to make the email field required in the user admin add and
change pages. Following some posts I read on stackoverflow I did this:
class MyUserCreationForm(UserCreationForm):
def __init__(self, *args, **kwargs):
super(MyUserCreationForm, self).__init__(*args, **kwargs)
#
I'm just wondering what the best way is to make User.email a required
field. I wouldn't think I'd be required to modify django's source but
I'm not sure.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
4 matches
Mail list logo