From ecfae508fceb4ea9b3697042ef2c13d5015de339 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 3eb3bbaf..f9cf68ca 100644 --- a/users/models.py +++ b/users/models.py @@ -682,10 +682,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.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