Skip to content

Commit

Permalink
apps/userdashboard: integrates new filter into user dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
hklarner authored and m4ra committed Aug 14, 2023
1 parent 208f7c0 commit 52491ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/userdashboard/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ def get_queryset(self):
+ Count("ai_report", distinct=True),
)

reported_by = self.request.query_params.get("reported_by")

if reported_by == "ai":
comments = comments.filter(ai_report__isnull=False)
elif reported_by == "users":
comments = comments.filter(reports__isnull=False)

return comments

def update(self, request, *args, **kwargs):
Expand Down

0 comments on commit 52491ad

Please sign in to comment.