mirror of https://github.com/zulip/zulip.git
Fix error handling for removing subscriptions.
(imported from commit b95a706ed9499e96c4ff27ca583ed10dab674736)
This commit is contained in:
parent
a8e4c818c6
commit
1fcb4c0576
|
@ -537,8 +537,10 @@ def json_remove_subscription(request):
|
|||
sub_name = request.POST.get('subscription')
|
||||
stream = get_stream(sub_name, user_profile.realm)
|
||||
if not stream:
|
||||
return json_error("Stream does not exist")
|
||||
did_remove = do_remove_subscription(user_profile, stream)
|
||||
if not did_remove:
|
||||
return json_error("Not subscribed, so you can't unsubscribe")
|
||||
do_remove_subscription(user_profile, stream)
|
||||
|
||||
return json_success({"data": sub_name})
|
||||
|
||||
|
|
Loading…
Reference in New Issue