Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Birin Sanchez
Keel - LDH Middleware
Commits
1d793461
Commit
1d793461
authored
May 08, 2019
by
Noe Nieto
💬
Browse files
convert userid and recovery email to lowercase to avoid problems like Purism/LibremOne/task#357
parent
f76fe7b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
cart/views.py
View file @
1d793461
...
...
@@ -69,6 +69,9 @@ class CartRegistrationForm(RegistrationForm):
super
(
CartRegistrationForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
fields
[
'username'
].
validators
.
append
(
validate_reserved_names
)
def
clean_email
(
self
):
return
self
.
cleaned_data
[
'email'
].
lower
()
class
CartRegistrationFormWithCaptcha
(
CartRegistrationForm
):
captcha
=
CaptchaField
(
...
...
purist/models.py
View file @
1d793461
...
...
@@ -88,6 +88,10 @@ class User(AbstractUser):
default
=
AccountType
.
UNDEFINED
)
billing_email
=
models
.
EmailField
(
default
=
''
,
null
=
False
)
def
clean
(
self
):
super
().
clean
()
self
.
email
=
self
.
email
.
lower
()
@
classmethod
def
normalize_username
(
cls
,
username
):
username
=
super
(
User
,
cls
).
normalize_username
(
username
)
...
...
Write
Preview
Supports
Markdown
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