diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2010-08-11 14:16:28 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2011-04-14 17:23:04 +0800 |
commit | 41f19b6643b44768dc06561c992c04ed6148477d (patch) | |
tree | 6f1c3d1fbe5e15e53d3c028a8e654f05b19e68fb /apps/patchwork/models.py | |
parent | c2c6a408c7764fa29389ce160f52776c9308d50a (diff) | |
download | patchwork-41f19b6643b44768dc06561c992c04ed6148477d.tar.bz2 patchwork-41f19b6643b44768dc06561c992c04ed6148477d.tar.xz |
Add email opt-out system
We're going to start generating emails on patchwork updates, so firstly
allow people to opt-out of all patchwork communications.
We do this with a 'mail settings' interface, allowing non-registered
users to set preferences on their email address. Logged-in users can do
this through the user profile view.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
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 806875b..f21d073 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -379,6 +379,7 @@ class EmailConfirmation(models.Model): type = models.CharField(max_length = 20, choices = [ ('userperson', 'User-Person association'), ('registration', 'Registration'), + ('optout', 'Email opt-out'), ]) email = models.CharField(max_length = 200) user = models.ForeignKey(User, null = True) @@ -400,4 +401,8 @@ class EmailConfirmation(models.Model): self.key = self._meta.get_field('key').construct(str).hexdigest() super(EmailConfirmation, self).save() +class EmailOptout(models.Model): + email = models.CharField(max_length = 200, primary_key = True) + def __unicode__(self): + return self.email |