mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-07 02:16:26 +00:00
Merge branch 'fix_197' into 'dev'
Avoid crash when 'email' field is not here See merge request federez/re2o!388
This commit is contained in:
commit
3ce8815c0d
1 changed files with 3 additions and 8 deletions
|
@ -1026,17 +1026,12 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
|
||||||
):
|
):
|
||||||
raise ValidationError("This pseudo is already in use.")
|
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):
|
if not self.local_email_enabled and not self.email and not (self.state == self.STATE_ARCHIVE):
|
||||||
raise ValidationError(
|
raise ValidationError(_("There is neither a local email address nor an external"
|
||||||
{'email': (
|
|
||||||
_("There is neither a local email address nor an external"
|
|
||||||
" email address for this user.")
|
" email address for this user.")
|
||||||
), }
|
|
||||||
)
|
)
|
||||||
if self.local_email_redirect and not self.email:
|
if self.local_email_redirect and not self.email:
|
||||||
raise ValidationError(
|
raise ValidationError(_("You can't redirect your local emails if no external email"
|
||||||
{'local_email_redirect': (
|
" address has been set.")
|
||||||
_("You can't redirect your local emails if no external email"
|
|
||||||
" address has been set.")), }
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in a new issue