Repository navigation
Conversation
An empty my_teams list made assigned_to_filter and assigned_or_suggested_filter return an empty Q(), and the inbox sort skipped its owner filter, so the search matched every issue. Return Q(pk__in=[]) for an empty list instead.
This was referenced Nov 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
assigned:my_teamsandassigned_or_suggested:my_teamsmatched every issue when the caller belongs to no teams.my_teamsresolves to the caller's teams. With none, the list is empty:assigned_to_filter([])andassigned_or_suggested_filter([])returned an emptyQ(), which filters nothing. The inbox sort had the same gap:if owner_search:skipped the owner filter on an empty list.Both filters now return
Q(pk__in=[])for an empty list, so the search matches nothing.!assigned:my_teamsstill matches everything, since excluding nothing keeps every row. Lists with at least one actor build the same query as before.Who hit this: members with no teams, and API key / org token callers. They have no user, so
get_teams_for_usersreturns no teams.Found while narrowing
request.userfor service accounts, which have no teams either.Evidence:
test_my_teams_without_teams_matches_nothing(search backend) andtest_sort_by_inbox_my_teams_without_teams(inbox sort) fail on master:and pass with the fix: