Add soft delete API for signups

This commit is contained in:
Aarni Halinen
2020-11-07 20:18:59 +02:00
parent 3a58ff0ef1
commit 1fe323cbdd
4 changed files with 39 additions and 3 deletions
+2 -2
View File
@@ -125,7 +125,7 @@ class SignupForm(models.Model):
class Signup(models.Model):
"""
In
Actual signup into any SignupForm. Deletes are soft.
"""
class Meta:
@@ -140,6 +140,7 @@ class Signup(models.Model):
email = models.EmailField(blank=True, null=True)
# Random unique identifier. Used for signup editing by the user.
uuid = models.UUIDField(default=uuid4, editable=False)
deleted = models.BooleanField(default=False)
def __str__(self):
return f"{self.signupForm}: {self.list_name} ({self.pk})"
@@ -147,7 +148,6 @@ class Signup(models.Model):
@receiver(post_save, sender=Signup)
def email_on_signup(sender, instance, created, **kwargs):
"""Send email validation."""
if created and instance.email:
# TODO: Possible bug due to many-to-many relationship with events and forms.
# TODO: Subject field crashes with lazy loaded translations.