From ee0a09de4ae781896a6e9f45da14f838d1595c35 Mon Sep 17 00:00:00 2001 From: aswanthabam Date: Sat, 4 Jan 2025 14:52:59 +0530 Subject: [PATCH] fix(leaderboard): student monthly leaderboard api --- api/leaderboard/leaderboard_view.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/api/leaderboard/leaderboard_view.py b/api/leaderboard/leaderboard_view.py index 2210043f..24861718 100644 --- a/api/leaderboard/leaderboard_view.py +++ b/api/leaderboard/leaderboard_view.py @@ -71,16 +71,10 @@ def get(self, request): ) .order_by("-total_karma")[:20] ) - data = [ - { - "full_name": student.full_name, - "total_karma": student.total_karma, - "institution": student.institution, - } - for student in student_monthly_leaderboard - ] - return CustomResponse(response=data).get_success_response() + return CustomResponse( + response=student_monthly_leaderboard + ).get_success_response() class CollegeLeaderboard(APIView):