FEAT: Add a fifteen min cooldown between emails to admins

Probably not the right way to go about it...but it does work!

TODO: How to handle cooldown-emailing shared mailbox addresses?
This commit is contained in:
2020-01-25 00:56:16 +00:00
parent c049874e5f
commit f19286efb0
4 changed files with 49 additions and 19 deletions

View File

@@ -28,6 +28,7 @@ class Profile(AbstractUser):
phone = models.CharField(max_length=13, null=True, blank=True)
api_key = models.CharField(max_length=40, blank=True, editable=False, null=True)
is_approved = models.BooleanField(default=False)
last_emailed = models.DateTimeField(blank=True, null=True) # Currently only populated by the admin approval email. TODO: Populate it each time we send any email, might need that...
@classmethod
def make_api_key(cls):