summaryrefslogtreecommitdiff
path: root/src/mailman/app/subscriptions.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-04-15 22:51:39 -0400
committerBarry Warsaw2015-04-15 22:51:39 -0400
commit08f457799cd36349a4fd22642f4c05b4eabb306d (patch)
treec4d2270bce3862e71a252d941e3942860a8c8565 /src/mailman/app/subscriptions.py
parent6c094ce9d81cd5e12ba13c851cbd1018ca3fb935 (diff)
downloadmailman-08f457799cd36349a4fd22642f4c05b4eabb306d.tar.gz
mailman-08f457799cd36349a4fd22642f4c05b4eabb306d.tar.zst
mailman-08f457799cd36349a4fd22642f4c05b4eabb306d.zip
Plumb the subscription policy through the REST API.
Diffstat (limited to 'src/mailman/app/subscriptions.py')
-rw-r--r--src/mailman/app/subscriptions.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mailman/app/subscriptions.py b/src/mailman/app/subscriptions.py
index aa9d600bf..1c6b96016 100644
--- a/src/mailman/app/subscriptions.py
+++ b/src/mailman/app/subscriptions.py
@@ -223,10 +223,16 @@ class SubscriptionWorkflow(Workflow):
if self.mlist.subscription_policy is SubscriptionPolicy.moderate:
self.push('moderation_checks')
return
- # If the subscription has been pre-confirmed, then we can skip to the
- # moderation checks.
+ # If the subscription has been pre-confirmed, then we can skip the
+ # confirmation check can be skipped. If moderator approval is
+ # required we need to check that, otherwise we can go straight to
+ # subscription.
if self.pre_confirmed:
- self.push('moderation_checks')
+ next_step = ('moderation_checks'
+ if self.mlist.subscription_policy is
+ SubscriptionPolicy.confirm_then_moderate
+ else 'do_subscription')
+ self.push(next_step)
return
# The user must confirm their subscription.
self.push('send_confirmation')
@@ -235,7 +241,8 @@ class SubscriptionWorkflow(Workflow):
# Does the moderator need to approve the subscription request?
assert self.mlist.subscription_policy in (
SubscriptionPolicy.moderate,
- SubscriptionPolicy.confirm_then_moderate)
+ SubscriptionPolicy.confirm_then_moderate,
+ ), self.mlist.subscription_policy
if self.pre_approved:
self.push('do_subscription')
else: