-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signup page #37
base: main
Are you sure you want to change the base?
signup page #37
Conversation
@@ -8,13 +8,17 @@ | |||
|
|||
|
|||
class SignUpForm(forms.ModelForm): | |||
first_name = forms.CharField(max_length=30, required=False, help_text='Optional.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CustomUser model has no firstname field
@@ -8,13 +8,17 @@ | |||
|
|||
|
|||
class SignUpForm(forms.ModelForm): | |||
first_name = forms.CharField(max_length=30, required=False, help_text='Optional.') | |||
last_name = forms.CharField(max_length=30, required=False, help_text='Optional.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CustomUser model has no lastname field
@@ -8,13 +8,17 @@ | |||
|
|||
|
|||
class SignUpForm(forms.ModelForm): | |||
first_name = forms.CharField(max_length=30, required=False, help_text='Optional.') | |||
last_name = forms.CharField(max_length=30, required=False, help_text='Optional.') | |||
email = forms.CharField(max_length=254, help_text='Required. Inform a valid email address.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already defined in models
first_name = forms.CharField(max_length=30, required=False, help_text='Optional.') | ||
last_name = forms.CharField(max_length=30, required=False, help_text='Optional.') | ||
email = forms.CharField(max_length=254, help_text='Required. Inform a valid email address.') | ||
phone_number = forms.CharField(max_length=15, required=False, help_text='Optional.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already defined on models, Don't repeat yourself
password1 = forms.CharField(label='Password', widget=forms.PasswordInput) | ||
password2 = forms.CharField( | ||
label='Password confirmation', widget=forms.PasswordInput) | ||
|
||
class Meta: | ||
model = User | ||
fields = ['name', 'email', 'phone'] | ||
fields = ('first_name', 'last_name', 'email','phone_number', 'password1', 'password2', ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields should be a name, email, and phone, due to the CustomUser model
No description provided.