Skip to content

Conversation

@ainebyoonabridget
Copy link

No description provided.



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


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.')
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

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.')
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

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.')
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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants