Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@


class SignUpForm(forms.ModelForm):
first_name = forms.CharField(max_length=30, required=False, help_text='Optional.')
Copy link
Owner

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

last_name = forms.CharField(max_length=30, required=False, help_text='Optional.')
Copy link
Owner

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

email = forms.CharField(max_length=254, help_text='Required. Inform a valid email address.')
Copy link
Owner

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

phone_number = forms.CharField(max_length=15, required=False, help_text='Optional.')
Copy link
Owner

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', )
Copy link
Owner

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


def clean_password2(self):
password1 = self.cleaned_data.get("password1")
Expand Down
Empty file added templates/signup.html
Empty file.