Skip to content

Commit

Permalink
♻️(backend) simplify queryset while listing rooms
Browse files Browse the repository at this point in the history
Recent refactoring simplified the DB models.
Thus, filtering rooms is now way simpler,
I updated the subsequent queryset.
  • Loading branch information
lebaudantoine committed Jul 22, 2024
1 parent e17d42e commit 88a5717
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/backend/core/api/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ def list(self, request, *args, **kwargs):

if user.is_authenticated:
queryset = (
self.filter_queryset(self.get_queryset())
.filter(Q(users=user))
.distinct()
self.filter_queryset(self.get_queryset()).filter(users=user).distinct()
)
else:
queryset = self.get_queryset().none()
Expand Down

0 comments on commit 88a5717

Please sign in to comment.