You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/07/18 18:08:37 UTC
[airavata-django-portal] branch staging updated: AIRAVATA-3490
Fixes bug by making sure to return a queryset when user is not a gateway
admin
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/staging by this push:
new bad4d5d AIRAVATA-3490 Fixes bug by making sure to return a queryset when user is not a gateway admin
bad4d5d is described below
commit bad4d5df86963cdb2299985ab265a78d72d631ca
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Sun Jul 18 14:06:47 2021 -0400
AIRAVATA-3490 Fixes bug by making sure to return a queryset when user is not a gateway admin
---
django_airavata/apps/auth/views.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/django_airavata/apps/auth/views.py b/django_airavata/apps/auth/views.py
index fb0d295..06d3cad 100644
--- a/django_airavata/apps/auth/views.py
+++ b/django_airavata/apps/auth/views.py
@@ -557,10 +557,10 @@ class UserViewSet(viewsets.ModelViewSet):
def get_queryset(self):
user = self.request.user
- if user.is_superuser:
+ if user.is_gateway_admin:
return get_user_model().objects.all()
else:
- return get_user_model().objects.get(pk=user.pk)
+ return get_user_model().objects.filter(pk=user.pk)
@action(detail=False)
def current(self, request):