Skip to content

Commit

Permalink
API: Fix filtering by source team for feedback
Browse files Browse the repository at this point in the history
The query parameters when the source was a team filters by adjudicator,
which is null, thus useless. This commit changes the filter to debate-
team__team.
  • Loading branch information
tienne-B committed Sep 16, 2020
1 parent e492b3b commit 3565dd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Change Log

- Fixed issue where team names with an institution were longer than the maximum size (`#1564 <https://github.com/TabbycatDebate/tabbycat/issues/1564>`_)
- Fixed issue that made saving motions impossible through the Round API detail endpoint
- Fixed issue that made filtering by source team impossible for the Feedback API

2.4.5
-----
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def get_queryset(self):
elif query_params.get('source_type') == 'team':
filters &= Q(source_adjudicator__isnull=True)
if query_params.get('source'):
filters &= Q(source_adjudicator__adjudicator_id=query_params.get('source'))
filters &= Q(source_team__team_id=query_params.get('source'))
if query_params.get('round'):
filters &= Q(source_adjudicator__debate__round__seq=query_params.get('round')) | Q(source_team__debate__round__seq=query_params.get('round'))
if query_params.get('target'):
Expand Down

0 comments on commit 3565dd0

Please sign in to comment.