streams: Remove dependency of streams on actions.

Refactored code in actions.py and streams.py to move stream related
functions into streams.py and remove the dependency on actions.py.

validate_sender_can_write_to_stream function in actions.py was renamed
to access_stream_for_send_message in streams.py.
This commit is contained in:
Udit107710
2020-03-24 13:47:41 +00:00
committed by Tim Abbott
parent 6dc12295db
commit 16218d6de3
14 changed files with 192 additions and 182 deletions

View File

@@ -7,6 +7,7 @@ from zerver.models import Realm, Stream, UserProfile, \
Subscription, Recipient, RealmAuditLog
from zerver.lib.create_user import create_user_profile, \
get_display_email_address
from zerver.lib.streams import render_stream_description
def bulk_create_users(realm: Realm,
users_raw: Set[Tuple[str, str, str, bool]],
@@ -111,7 +112,6 @@ def bulk_create_streams(realm: Realm,
options['history_public_to_subscribers'] = (
not options.get("invite_only", False) and not realm.is_zephyr_mirror_realm)
if name.lower() not in existing_streams:
from zerver.lib.actions import render_stream_description
streams_to_create.append(
Stream(
realm=realm,