-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. CustomUser model has no lastname field |
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This is already defined in models |
||
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 commentThe 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 commentThe 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 |
||
|
||
def clean_password2(self): | ||
password1 = self.cleaned_data.get("password1") | ||
|
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