From 01475bd786de09b46759b39f0d40ff43c6d67091 Mon Sep 17 00:00:00 2001 From: Yoann Pietri Date: Sun, 15 Jul 2018 16:59:45 +0200 Subject: [PATCH] =?UTF-8?q?Alt=C3=A9ration=20de=20la=20m=C3=A9thode=20has?= =?UTF-8?q?=5Faccess=20pour=20prendre=20en=20compte=20la=20v=C3=A9rificati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/users/models.py b/users/models.py index b9284b08..58250ed2 100644 --- a/users/models.py +++ b/users/models.py @@ -414,7 +414,11 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, def has_access(self): """ Renvoie si un utilisateur a accès à internet """ - return (self.state == User.STATE_ACTIVE and + if(OptionalUser.get_cached_value('mail_verification') and not self.verified and self.verification_deadline is not None and datetime.now() > self.verification_deadline): + verified = False + else: + verified = True + return (verified and self.state == User.STATE_ACTIVE and not self.is_ban() and (self.is_connected() or self.is_whitelisted()))