Commit fd6ffd9a authored by John Red Medrano's avatar John Red Medrano

Merge branch 'product-dev' into 'product-sit'

Product dev

See merge request rms/Backend/api-main-service!864
parents 33703ce4 f588bccb
......@@ -26,10 +26,13 @@ class UserDownloadRequest(XLSXFileMixin, ReadOnlyModelViewSet):
def list(self, request, *args, **kwargs):
# id_number = self.request.user
# comment
data = User.objects.all().exclude(id=1)
user_type = data.values_list('user_type', flat=True)[0]
print("this")
print(user_type)
if user_type == 'CUA':
code = data.values_list('department__company', flat=True)[0]
data = User.objects.filter(
......@@ -42,6 +45,7 @@ class UserDownloadRequest(XLSXFileMixin, ReadOnlyModelViewSet):
data = User.objects.all().exclude(id=1)
elif user_type == 'OUA':
data = User.objects.all().exclude(id=1)
else:
return Response(
{"message": "Logged user is unauthorize to access this section"},
......
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