From 7bb62daf42467d3c20d23037b7b751aeef82700f Mon Sep 17 00:00:00 2001 From: chirac Date: Fri, 29 Jun 2018 18:53:39 +0200 Subject: [PATCH] Fix compte mail , get_mail si redirection --- users/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/users/models.py b/users/models.py index 37204a45..f9445753 100644 --- a/users/models.py +++ b/users/models.py @@ -679,10 +679,10 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ Return the mail address choosen by the user """ - if not OptionalUser.get_cached_value('mail_accounts') or not self.internal_address: - return self.external_mail + if not OptionalUser.get_cached_value('mail_accounts') or not self.internal_address or self.redirection: + return str(self.external_mail) else: - return self.mail.mailalias_set.get(valeur=self.pseudo) + return str(self.mailalias_set.get(valeur=self.pseudo)) def get_next_domain_name(self): """Look for an available name for a new interface for