Users can log in iff they are or were a member, don't display the database to everyone

This commit is contained in:
Yohann D'ANELLO 2021-11-04 15:04:57 +01:00
parent 41435a6838
commit aceb0d893c
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,9 @@ class User(AbstractUser):
date_end=membership_dict['date_end'],
)
# Only members or old members are allow to connect to the website
self.is_active = Membership.objects.filter(user=self).exists()
class Membership(models.Model):
user = models.ForeignKey(