diff options
| author | Barry Warsaw | 2016-09-08 19:49:00 +1200 |
|---|---|---|
| committer | Barry Warsaw | 2016-09-08 19:49:00 +1200 |
| commit | 447b9bd6df0113ca7e2332d6ad20c01691f3ce07 (patch) | |
| tree | 637eff5c4d0923ae801e225ef0ce09a9821e2642 /src/mailman/app/subscriptions.py | |
| parent | 54ae6bb8c78998c533b75d81c3b3e72151813d9e (diff) | |
| download | mailman-447b9bd6df0113ca7e2332d6ad20c01691f3ce07.tar.gz mailman-447b9bd6df0113ca7e2332d6ad20c01691f3ce07.tar.zst mailman-447b9bd6df0113ca7e2332d6ad20c01691f3ce07.zip | |
Diffstat (limited to 'src/mailman/app/subscriptions.py')
| -rw-r--r-- | src/mailman/app/subscriptions.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mailman/app/subscriptions.py b/src/mailman/app/subscriptions.py index fb712d979..52c0ddfbc 100644 --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -550,8 +550,19 @@ class BaseSubscriptionManager: def __init__(self, mlist): self._mlist = mlist + def _get_workflow(self): + raise NotImplementedError + + def register(self, subscriber=None, *, + pre_verified=False, pre_confirmed=False, pre_approved=False): + raise NotImplementedError + + def unregister(self, subscriber=None, *, + pre_confirmed=False, pre_approved=False): + raise NotImplementedError + def confirm(self, token): - workflow = self.__class__(self._mlist) + workflow = self._get_workflow() workflow.token = token workflow.restore() # In order to just run the whole workflow, all we need to do @@ -573,6 +584,9 @@ class BaseSubscriptionManager: class SubscriptionWorkflowManager(BaseSubscriptionManager): """Handle registrations and confirmations for subscriptions.""" + def _get_workflow(self): + return SubscriptionWorkflow(self._mlist) + def register(self, subscriber=None, *, pre_verified=False, pre_confirmed=False, pre_approved=False): """See `ISubscriptionManager`.""" @@ -590,6 +604,9 @@ class SubscriptionWorkflowManager(BaseSubscriptionManager): class UnsubscriptionWorkflowManager(BaseSubscriptionManager): """Handle un-subscriptions and confirmations for un-subscriptions.""" + def _get_workflow(self): + return UnSubscriptionWorkflow(self._mlist) + def unregister(self, subscriber=None, *, pre_confirmed=False, pre_approved=False): workflow = UnSubscriptionWorkflow( |
