]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/models.py
Merge branch 'notifications'
[patchwork] / apps / patchwork / models.py
index 17a68db8077ea6332e53aba419cca2e024c41a2c..22062c2189f468eb20e4b8ad2ff1f9e1a16b3632 100644 (file)
@@ -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)