Simplify stream access denied error message.

Otherwise, we'll report that a stream is invite-only when it isn't.

(imported from commit 441db1c84fb19bdf564251a1bd80ace23151783d)
This commit is contained in:
Tim Abbott
2013-08-22 11:54:57 -04:00
parent a356a0a229
commit 9e372118a9
2 changed files with 2 additions and 2 deletions

View File

@@ -2044,7 +2044,7 @@ class InviteOnlyStreamTest(AuthedTestCase):
email = "othello@zulip.com"
self.login(email)
result = self.common_subscribe_to_streams(email, ["Saxony"])
self.assert_json_error(result, 'Unable to access invite-only stream (Saxony).')
self.assert_json_error(result, 'Unable to access stream (Saxony).')
# authorization_errors_fatal=False works
email = "othello@zulip.com"

View File

@@ -1442,7 +1442,7 @@ def add_subscriptions_backend(request, user_profile,
authorized_streams, unauthorized_streams = \
filter_stream_authorization(user_profile, existing_streams)
if len(unauthorized_streams) > 0 and authorization_errors_fatal:
return json_error("Unable to access invite-only stream (%s)." % unauthorized_streams[0].name)
return json_error("Unable to access stream (%s)." % unauthorized_streams[0].name)
# Newly created streams are also authorized for the creator
streams = authorized_streams + created_streams