Fakultas Ilmu Komputer UI

Commit 8720739d authored by Dave Nathanael's avatar Dave Nathanael
Browse files

[GREEN] Implement to list all logs for admin accounts' requests

parent 971613ab
Pipeline #39083 passed with stages
in 26 minutes and 34 seconds
......@@ -20,6 +20,10 @@ class LogViewSet(viewsets.ViewSet):
def list(self, request):
paginator = PageNumberPagination()
queryset = self.queryset.filter(author=request.user.account)
if request.user.account.is_admin:
queryset = Log.objects.all()
context = paginator.paginate_queryset(queryset, request)
serializer = LogSummarySerializer(context, many=True)
return paginator.get_paginated_response(serializer.data)
Supports Markdown
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