~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/model/address.py

  • Committer: Barry Warsaw
  • Date: 2012-04-07 21:46:05 UTC
  • Revision ID: barry@list.org-20120407214605-th680lxpag471tdr
 * An `AddressVerificationEvent` is triggered when an `IAddress` is verified
   or unverified.  (LP: #975698)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from email.utils import formataddr
29
29
from storm.locals import DateTime, Int, Reference, Unicode
 
30
from zope.event import notify
30
31
from zope.interface import implements
31
32
 
32
33
from mailman.database.model import Model
33
 
from mailman.interfaces.address import IAddress
 
34
from mailman.interfaces.address import AddressVerificationEvent, IAddress
34
35
from mailman.utilities.datetime import now
35
36
 
36
37
 
42
43
    email = Unicode()
43
44
    _original = Unicode()
44
45
    display_name = Unicode()
45
 
    verified_on = DateTime()
 
46
    _verified_on = DateTime(name='verified_on')
46
47
    registered_on = DateTime()
47
48
 
48
49
    user_id = Int()
73
74
                address_str, verified, self.email, id(self))
74
75
 
75
76
    @property
 
77
    def verified_on(self):
 
78
        return self._verified_on
 
79
 
 
80
    @verified_on.setter
 
81
    def verified_on(self, timestamp):
 
82
        self._verified_on = timestamp
 
83
        notify(AddressVerificationEvent(self))
 
84
 
 
85
    @property
76
86
    def original_email(self):
77
87
        return (self.email if self._original is None else self._original)