From 2e24a468947e26aff1f3a89393da18892627312e Mon Sep 17 00:00:00 2001 From: Aswanth Vc Date: Wed, 9 Oct 2024 01:18:44 +0530 Subject: [PATCH] fix: rank calculation issue fixed --- api/dashboard/profile/profile_serializer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/dashboard/profile/profile_serializer.py b/api/dashboard/profile/profile_serializer.py index 19e10b06..8bb73f52 100644 --- a/api/dashboard/profile/profile_serializer.py +++ b/api/dashboard/profile/profile_serializer.py @@ -166,7 +166,7 @@ def get_rank(self, obj): ] ) ) - .order_by("-karma") + .order_by("-karma", "-updated_at", "created_at") ) ranks = list(ranks.values_list("user_id", flat=True)) return ranks.index(obj.id) + 1 @@ -284,7 +284,7 @@ def get_rank(self, obj): ] ) ) - .order_by("-karma") + .order_by("-karma", "-updated_at", "created_at") ) ranks = list(ranks.values_list("user_id", flat=True))