summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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