X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Fmodels.py;h=22062c2189f468eb20e4b8ad2ff1f9e1a16b3632;hb=75d8cf966034e673afe0077ba393d8b2eb3e9b93;hp=17a68db8077ea6332e53aba419cca2e024c41a2c;hpb=798a73b8bfb41f742e78e481ab9c961556e117b3;p=patchwork diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index 17a68db..22062c2 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -408,6 +408,11 @@ class EmailOptout(models.Model): def __unicode__(self): return self.email + @classmethod + def is_optout(cls, email): + email = email.lower().strip() + return cls.objects.filter(email = email).count() > 0 + class PatchChangeNotification(models.Model): patch = models.ForeignKey(Patch, primary_key = True) last_modified = models.DateTimeField(default = datetime.datetime.now)