~abompard/mailman/subpolicy

« back to all changes in this revision

Viewing changes to src/mailman/app/subscriptions.py

  • Committer: Barry Warsaw
  • Date: 2015-04-07 02:12:37 UTC
  • Revision ID: barry@list.org-20150407021237-teu8vyk6vhjr1vzo
Check pointing

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
    def __init__(self, mlist, subscriber,
73
73
                 pre_verified, pre_confirmed, pre_approved):
74
 
        super(SubscriptionWorkflow, self).__init__()
 
74
        super().__init__()
75
75
        self.mlist = mlist
76
76
        # The subscriber must be either an IUser or IAddress.
77
77
        if IAddress.providedBy(subscriber):
80
80
        elif IUser.providedBy(subscriber):
81
81
            self.address = subscriber.preferred_address
82
82
            self.user = subscriber
 
83
        else:
 
84
            raise AssertionError('subscriber is neither an IUser nor IAddress')
83
85
        self.subscriber = subscriber
84
86
        self.pre_verified = pre_verified
85
87
        self.pre_confirmed = pre_confirmed
86
88
        self.pre_approved = pre_approved
87
 
        # State saving
88
 
        self.SAVE_KEY = '{}:{}'.format(self.mlist.list_id, self.address.email)
89
89
 
90
90
    def _maybe_set_preferred_address(self):
91
91
        if self.user is None: