Commit 69019450 authored by Gladys Forte's avatar Gladys Forte

Merge branch 'core-dev-gladys' into 'core-dev'

{dev bugfix} SU and OUA added query

See merge request rms/Backend/api-main-service!846
parents 4f2b8650 a8651357
...@@ -39,15 +39,15 @@ class UserDownloadRequest(XLSXFileMixin, ReadOnlyModelViewSet): ...@@ -39,15 +39,15 @@ class UserDownloadRequest(XLSXFileMixin, ReadOnlyModelViewSet):
data = User.objects.filter( data = User.objects.filter(
department=code).exclude(id=1) department=code).exclude(id=1)
elif user_type == 'SU': elif user_type == 'SU':
pass data = User.objects.all().exclude(id=1)
elif user_type == 'OUA': elif user_type == 'OUA':
pass data = User.objects.all().exclude(id=1)
else: else:
return Response( return Response(
{"message": "Logged user is unauthorize to access this section"}, {"message": "Logged user is unauthorize to access this section"},
status=status.HTTP_400_BAD_REQUEST status=status.HTTP_400_BAD_REQUEST
) )
serializer = headers(data=data, many=True) serializer = headers(data=data, many=True)
serializer.is_valid(raise_exception=False) serializer.is_valid(raise_exception=False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment