diff --git a/zerver/lib/streams.py b/zerver/lib/streams.py index ef8c54e1ff..e2739672f5 100644 --- a/zerver/lib/streams.py +++ b/zerver/lib/streams.py @@ -625,7 +625,7 @@ def list_to_streams( streams_raw: Collection[StreamDict], user_profile: UserProfile, autocreate: bool = False, - admin_access_required: bool = False, + unsubscribing_others: bool = False, ) -> Tuple[List[Stream], List[Stream]]: """Converts list of dicts to a list of Streams, validating input in the process @@ -654,7 +654,7 @@ def list_to_streams( missing_stream_dicts: List[StreamDict] = [] existing_stream_map = bulk_get_streams(user_profile.realm, stream_set) - if admin_access_required: + if unsubscribing_others: existing_recipient_ids = [stream.recipient_id for stream in existing_stream_map.values()] subs = Subscription.objects.filter( user_profile=user_profile, recipient_id__in=existing_recipient_ids, active=True diff --git a/zerver/views/streams.py b/zerver/views/streams.py index d301bddf60..351af47d2d 100644 --- a/zerver/views/streams.py +++ b/zerver/views/streams.py @@ -424,7 +424,7 @@ def remove_subscriptions_backend( streams_as_dict.append({"name": stream_name.strip()}) streams, __ = list_to_streams( - streams_as_dict, user_profile, admin_access_required=removing_someone_else + streams_as_dict, user_profile, unsubscribing_others=removing_someone_else ) if principals: