8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Allow suspended users to login

This commit is contained in:
Jean-Romain Garnier 2020-04-17 16:57:29 +02:00 committed by Gabriel Detraz
parent 0dcd8b79e2
commit bcb22f1382

View file

@ -335,6 +335,7 @@ class User(
self.state == self.STATE_ACTIVE self.state == self.STATE_ACTIVE
or self.state == self.STATE_NOT_YET_ACTIVE or self.state == self.STATE_NOT_YET_ACTIVE
or self.state == self.STATE_EMAIL_NOT_YET_CONFIRMED or self.state == self.STATE_EMAIL_NOT_YET_CONFIRMED
or self.state == self.STATE_SUSPENDED
or ( or (
allow_archived allow_archived
and self.state in (self.STATE_ARCHIVE, self.STATE_FULL_ARCHIVE) and self.state in (self.STATE_ARCHIVE, self.STATE_FULL_ARCHIVE)
@ -344,7 +345,7 @@ class User(
def set_active(self): def set_active(self):
"""Enable this user if he subscribed successfully one time before """Enable this user if he subscribed successfully one time before
Reenable it if it was archived Reenable it if it was archived
Do nothing if disabled or waiting for email confirmation""" Do nothing if suspended, disabled or waiting for email confirmation"""
if self.state == self.STATE_NOT_YET_ACTIVE: if self.state == self.STATE_NOT_YET_ACTIVE:
if self.facture_set.filter(valid=True).filter( if self.facture_set.filter(valid=True).filter(
Q(vente__type_cotisation="All") | Q(vente__type_cotisation="Adhesion") Q(vente__type_cotisation="All") | Q(vente__type_cotisation="Adhesion")