1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Test and cover fully member app

This commit is contained in:
Yohann D'ANELLO
2020-09-02 22:54:01 +02:00
parent 1b8cb7abb0
commit bf7f5b9cd6
8 changed files with 490 additions and 115 deletions

View File

@ -118,7 +118,7 @@ class ConsumerViewSet(ReadOnlyProtectedModelViewSet):
queryset = super().get_queryset()
# Sqlite doesn't support ORDER BY in subqueries
queryset = queryset.order_by("username") \
queryset = queryset.order_by("name") \
if settings.DATABASES[queryset.db]["ENGINE"] == 'django.db.backends.postgresql' else queryset
alias = self.request.query_params.get("alias", ".*")
@ -140,6 +140,9 @@ class ConsumerViewSet(ReadOnlyProtectedModelViewSet):
),
all=True)
queryset = queryset if settings.DATABASES[queryset.db]["ENGINE"] == 'django.db.backends.postgresql' \
else queryset.order_by("name")
return queryset.distinct()