1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-27 08:53:03 +00:00

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

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(