def get_subscription(stream_name: Text, user_profile: UserProfile) -> Subscription: stream = get_stream(stream_name, user_profile.realm) recipient = get_stream_recipient(stream.id) return Subscription.objects.get(user_profile=user_profile, recipient=recipient, active=True)
def get_subscription(stream_name: str, user_profile: UserProfile) -> Subscription: stream = get_stream(stream_name, user_profile.realm) recipient = get_stream_recipient(stream.id) return Subscription.objects.get(user_profile=user_profile, recipient=recipient, active=True)