Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

minor: Update comment for guest subscription access.

Steve Howell40b0c36d21b5
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 93c5b9fc6bb..31cc0bf5f27 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -2670,9 +2670,10 @@ def validate_user_access_to_subscribers_helper(
if user_profile.is_guest:
if check_user_subscribed(user_profile):
return
- # We could put an AssertionError here; in that we don't have
- # any code paths that would allow a guest user to access other
- # streams in the first place.
+ # We could explicitly handle the case where guests aren't
+ # subscribed here in an `else` statement or we can fall
+ # through to the subsequent logic. Tim prefers the latter.
+ # Adding an `else` would ensure better code coverage.
if not user_profile.can_access_public_streams() and not stream_dict["invite_only"]:
raise JsonableError(_("Subscriber data is not available for this stream"))