mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
home: Fix parsing bug for initial narrows.
There's more we'll want to do here, but this at least avoids error emails when users attempt to misuse this interface.
This commit is contained in:
@@ -117,12 +117,13 @@ def home_real(request: HttpRequest) -> HttpResponse:
|
||||
narrow_topic = request.GET.get("topic")
|
||||
if request.GET.get("stream"):
|
||||
try:
|
||||
# TODO: We should support stream IDs and PMs here as well.
|
||||
narrow_stream_name = request.GET.get("stream")
|
||||
(narrow_stream, ignored_rec, ignored_sub) = access_stream_by_name(
|
||||
user_profile, narrow_stream_name)
|
||||
narrow = [["stream", narrow_stream.name]]
|
||||
except Exception:
|
||||
logging.exception("Narrow parsing exception", extra=dict(request=request))
|
||||
logging.warning("Invalid narrow requested, ignoring", extra=dict(request=request))
|
||||
if narrow_stream is not None and narrow_topic is not None:
|
||||
narrow.append(["topic", narrow_topic])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user