Skip to content

Commit

Permalink
Raise value error and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
aliu39 committed May 16, 2024
1 parent 81160ba commit 3f140db
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/sentry/replays/usecases/query/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,9 @@ def handle_viewed_by_me_filters(
value = value.lower() == "true"

if request_user_id is None:
if value: # use an always-false filter so query returns nothing
return [
SearchFilter(SearchKey("id"), "=", SearchValue("a" * 32)),
"AND",
SearchFilter(SearchKey("id"), "!=", SearchValue("a" * 32)),
]
return []
# This case will only occur from programmer error.
# Note the replay index endpoint returns 401 automatically for unauthorized and anonymous users.
raise ValueError("Invalid user id")

operator = "=" if value else "!="
new_filters.append(
Expand Down

0 comments on commit 3f140db

Please sign in to comment.