Skip to content

Instantly share code, notes, and snippets.

@brunomichetti
Created August 21, 2023 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunomichetti/065ed6ec6dd06d34260b4af4c93edeaa to your computer and use it in GitHub Desktop.
Save brunomichetti/065ed6ec6dd06d34260b4af4c93edeaa to your computer and use it in GitHub Desktop.
# Add this to the UserViewSet
@action(detail=False, methods=("GET",))
def metrics(self, request):
"""
Calculates and returns the metrics of the users.
"""
metrics_dict = get_user_metrics()
return Response(metrics_dict, status.HTTP_200_OK)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment