8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 15:33:45 +00:00

Altération de la méthode has_access pour prendre en compte la vérification

This commit is contained in:
Yoann Pétri 2018-07-15 16:59:45 +02:00 committed by root
parent 00f53a8d9a
commit 01475bd786

View file

@ -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()))