Skip to content

Commit

Permalink
For analytics speed
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-smith committed Sep 21, 2024
1 parent b6ef184 commit 30bfa4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,8 @@ def quality_check(self, request):
]
return Response({"results": res})

@method_decorator(cache_page(60 * SHORT_CACHE_TTL))
@method_decorator(vary_on_cookie)
@action(detail=True, methods=["get"])
def global_score(self, request, pk):
"""Returns the global score of the compliance assessment"""
Expand Down Expand Up @@ -1820,6 +1822,8 @@ def export(self, request, pk):
else:
return Response({"error": "Permission denied"})

@method_decorator(cache_page(60 * SHORT_CACHE_TTL))
@method_decorator(vary_on_cookie)
@action(detail=True, methods=["get"])
def donut_data(self, request, pk):
compliance_assessment = ComplianceAssessment.objects.get(id=pk)
Expand Down

0 comments on commit 30bfa4b

Please sign in to comment.