mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
refactoring: Replaced occurences of create_stream_if_needed.
Issue #2088 asked for a wrapper to be created for `create_stream_if_needed` (called `ensure_stream`) for the 25 times that `create_stream_if_needed` is called and ignores whether the stream was created. This commit replaces relevant occurences of `create_stream_if_needed` with `ensure_stream`, including imports. The changes weren't significant enough to add any tests or do any additional manual testing. The refactoring intended to make the API easier to use in most cases. The majority of uses of `create_stream_if_needed` ignored the second parameter. Fixes: #2088.
This commit is contained in:
committed by
Tim Abbott
parent
11c995b70f
commit
3396cfc2ef
@@ -24,7 +24,7 @@ from zerver.lib.actions import (
|
||||
do_reactivate_realm,
|
||||
do_reactivate_user,
|
||||
do_set_realm_authentication_methods,
|
||||
create_stream_if_needed,
|
||||
ensure_stream,
|
||||
)
|
||||
from zerver.lib.mobile_auth_otp import otp_decrypt_api_key
|
||||
from zerver.lib.validator import validate_login_email, \
|
||||
@@ -931,7 +931,7 @@ class GoogleSubdomainLoginTest(GoogleOAuthTest):
|
||||
stream_names = ["new_stream_1", "new_stream_2"]
|
||||
streams = []
|
||||
for stream_name in set(stream_names):
|
||||
stream, _ = create_stream_if_needed(realm, stream_name)
|
||||
stream = ensure_stream(realm, stream_name)
|
||||
streams.append(stream)
|
||||
|
||||
# Without the invite link, we can't create an account due to invite_required
|
||||
|
||||
Reference in New Issue
Block a user