def get_subscribers_query(stream: Stream, requesting_user: Optional[UserProfile]) -> QuerySet:
    " Build a query to get the subscribers list for a stream, raising a JsonableError if:\n\n    'realm' is optional in stream.\n\n    The caller can refine this query with select_related(), values(), etc. depending\n    on whether it wants objects or just certain fields\n    "
    validate_user_access_to_subscribers(requesting_user, stream)
    subscriptions = get_active_subscriptions_for_stream_id(stream.id).filter(user_profile__is_active=True)
    return subscriptions
Build a query to get the subscribers list for a stream, raising a JsonableError if:

'realm' is optional in stream.

The caller can refine this query with select_related(), values(), etc. depending
on whether it wants objects or just certain fields
def get_subscribers_query(stream: Stream, requesting_user: Optional[UserProfile]) -> QuerySet:
    " Build a query to get the subscribers list for a stream, raising a JsonableError if:\n\n    'realm' is optional in stream.\n\n    The caller can refine this query with select_related(), values(), etc. depending\n    on whether it wants objects or just certain fields\n    "
    validate_user_access_to_subscribers(requesting_user, stream)
    subscriptions = get_active_subscriptions_for_stream_id(stream.id).filter(user_profile__is_active=True)
    return subscriptions