diff options
Diffstat (limited to 'apps/patchwork/models.py')
-rw-r--r-- | apps/patchwork/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
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) |