Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Hunger Buster - Breadcrumbs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julia Santos
Hunger Buster - Breadcrumbs
Commits
abb8bc56
Commit
abb8bc56
authored
Mar 26, 2021
by
Sylvane Suminguit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor edits to fix second iteration
parent
4f6e37f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
views.py
accounts/views.py
+4
-1
No files found.
accounts/views.py
View file @
abb8bc56
...
@@ -3,6 +3,8 @@ from django.contrib.auth.forms import UserCreationForm, User
...
@@ -3,6 +3,8 @@ from django.contrib.auth.forms import UserCreationForm, User
from
django.urls
import
reverse_lazy
from
django.urls
import
reverse_lazy
from
django.views
import
generic
from
django.views
import
generic
from
django
import
forms
from
django
import
forms
from
django.core.exceptions
import
ValidationError
class
UserCreateForm
(
UserCreationForm
):
class
UserCreateForm
(
UserCreationForm
):
email
=
forms
.
EmailField
(
required
=
True
,
label
=
'Email'
,)
email
=
forms
.
EmailField
(
required
=
True
,
label
=
'Email'
,)
...
@@ -17,9 +19,10 @@ class UserCreateForm(UserCreationForm):
...
@@ -17,9 +19,10 @@ class UserCreateForm(UserCreationForm):
if
commit
:
if
commit
:
user
.
save
()
user
.
save
()
return
user
return
user
"""
def clean_email(self):
def clean_email(self):
if User.objects.filter(email=self.cleaned_data['email']).exists():
if User.objects.filter(email=self.cleaned_data['email']).exists():
raise ValidationError(self.fields['email'].error_messages['exists'])
raise ValidationError(self.fields['email'].error_messages['exists'])
return self.cleaned_data['email']
return self.cleaned_data['email']
"""
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment