summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnirudh Dahiya2016-03-11 19:32:49 +0530
committerBarry Warsaw2016-03-22 20:36:46 -0400
commit620b4d4487b0c8e714fc37c98cdb75e039b828b2 (patch)
treefd9f8a21e5e237d82cd5047cd9822dd150464191
parent91aa1c7a2dda8e4a4c2f544abdd9ae3dbbe231e7 (diff)
downloadmailman-620b4d4487b0c8e714fc37c98cdb75e039b828b2.tar.gz
mailman-620b4d4487b0c8e714fc37c98cdb75e039b828b2.tar.zst
mailman-620b4d4487b0c8e714fc37c98cdb75e039b828b2.zip
-rw-r--r--src/mailman/rest/members.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mailman/rest/members.py b/src/mailman/rest/members.py
index ea47b50d6..9bbefbfc1 100644
--- a/src/mailman/rest/members.py
+++ b/src/mailman/rest/members.py
@@ -263,11 +263,7 @@ class AllMembers(_MemberBase):
# Now we can run the registration process until either the
# subscriber is subscribed, or the workflow is paused for
# verification, confirmation, or approval.
- try:
- registrar = IRegistrar(mlist)
- except SubscriptionPendingError:
- conflict(response ,b'Subscrition request already pending')
- return
+ registrar = IRegistrar(mlist)
try:
token, token_owner, member = registrar.register(
subscriber,
@@ -283,6 +279,9 @@ class AllMembers(_MemberBase):
except MembershipIsBannedError:
bad_request(response, b'Membership is banned')
return
+ except SubscriptionPendingError:
+ conflict(response ,b'Subscription request already pending')
+ return
if token is None:
assert token_owner is TokenOwner.no_one, token_owner
# The subscription completed. Let's get the resulting member