diff options
author | Alban Gruin | 2017-09-09 14:56:17 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-09 14:56:17 +0200 |
commit | c7fce37ad4c8dee76f5d58eafefd0c73a03ea00c (patch) | |
tree | f86af8322495101ce11e187f8145f8f4d9519236 /models.py | |
parent | 9aaa19a62b36e1b0981233785e150f50449c78e3 (diff) |
Suppression de l’envoi des mails
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 24 |
1 files changed, 0 insertions, 24 deletions
@@ -20,9 +20,6 @@ from django.utils.text import slugify from .utils import parse_group -import hashlib -import os - class Year(models.Model): name = models.CharField(max_length=16, verbose_name="année") @@ -118,27 +115,6 @@ class Group(models.Model): verbose_name_plural = "groupes" -class Subscription(models.Model): - email = models.EmailField(verbose_name="adresse") - group = models.ForeignKey(Group, on_delete=models.CASCADE, verbose_name="groupe") - active = models.BooleanField(verbose_name="activé", default=False, db_index=True) - token = models.CharField(max_length=64, unique=True, default="") - - def __str__(self): - return "{0} - {1}".format(self.email, self.group) - - def save(self, *args, **kwargs): - if self.token == "": - self.token = hashlib.sha1(os.urandom(128)).hexdigest() - super(Subscription, self).save(*args, **kwargs) - - - class Meta: - unique_together = ("email", "group",) - verbose_name = "abonnement" - verbose_name_plural = "abonnements" - - class Room(models.Model): name = models.CharField(max_length=255, unique=True, verbose_name="nom") |