Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o
Commits
3ce8815c
Commit
3ce8815c
authored
Jan 05, 2019
by
klafyvel
Browse files
Merge branch 'fix_197' into 'dev'
Avoid crash when 'email' field is not here See merge request federez/re2o!388
parents
6bf29f0c
84889388
Pipeline
#933
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
users/models.py
View file @
3ce8815c
...
...
@@ -1026,17 +1026,12 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
):
raise
ValidationError
(
"This pseudo is already in use."
)
if
not
self
.
local_email_enabled
and
not
self
.
email
and
not
(
self
.
state
==
self
.
STATE_ARCHIVE
):
raise
ValidationError
(
{
'email'
:
(
_
(
"There is neither a local email address nor an external"
raise
ValidationError
(
_
(
"There is neither a local email address nor an external"
" email address for this user."
)
),
}
)
if
self
.
local_email_redirect
and
not
self
.
email
:
raise
ValidationError
(
{
'local_email_redirect'
:
(
_
(
"You can't redirect your local emails if no external email"
" address has been set."
)),
}
raise
ValidationError
(
_
(
"You can't redirect your local emails if no external email"
" address has been set."
)
)
def
__str__
(
self
):
...
...
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