mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
update_stream_backend: Use access_stream_by_id.
This commit is contained in:
@@ -122,7 +122,7 @@ class StreamAdminTest(ZulipTestCase):
|
||||
}
|
||||
stream_id = get_stream('private_stream', user_profile.realm).id
|
||||
result = self.client_patch("/json/streams/%d" % (stream_id,), params)
|
||||
self.assert_json_error(result, 'You are not invited to this stream.')
|
||||
self.assert_json_error(result, 'Invalid stream id')
|
||||
|
||||
self.subscribe_to_stream(email, 'private_stream')
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ def update_stream_backend(request, user_profile, stream_id,
|
||||
is_private=REQ(validator=check_bool, default=None),
|
||||
new_name=REQ(validator=check_string, default=None)):
|
||||
# type: (HttpRequest, UserProfile, int, Optional[Text], Optional[bool], Optional[Text]) -> HttpResponse
|
||||
stream = get_and_validate_stream_by_id(stream_id, user_profile.realm)
|
||||
(stream, recipient, sub) = access_stream_by_id(user_profile, stream_id)
|
||||
|
||||
if description is not None:
|
||||
do_change_stream_description(user_profile.realm, stream.name, description)
|
||||
|
||||
Reference in New Issue
Block a user