File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -565,19 +565,18 @@ def leaderboard_data(request):
565
565
lb_data [user_profile .user .username ] = user_profile .net_worth
566
566
sorted_lb_data = sorted (
567
567
lb_data .items (), key = operator .itemgetter (1 ), reverse = True )
568
- list_user_name = [x [0 ] for x in sorted_lb_data ][:10 ]
569
- list_net_worth = [x [1 ] for x in sorted_lb_data ][:10 ]
570
- count = len (list_net_worth )
571
- list_rank = [i for i in range (1 , count + 1 )]
572
-
573
- user_profile = UserProfile .objects .get (user = request .user )
574
-
568
+ list_user_name = [x [0 ] for x in sorted_lb_data ]
575
569
try :
576
570
current_user_rank = list_user_name .index (user_profile .user .username )
577
571
except :
578
572
response_data = {'status' : 'error' ,
579
573
'message' : 'Error in Retrieving Rank for Current User' }
580
574
return JsonResponse (response_data )
575
+ list_user_name = list_user_name [:10 ]
576
+ list_net_worth = [x [1 ] for x in sorted_lb_data ][:10 ]
577
+ count = len (list_net_worth )
578
+ list_rank = [i for i in range (1 , count + 1 )]
579
+ user_profile = UserProfile .objects .get (user = request .user )
581
580
582
581
try :
583
582
user_profile .net_worth = 0
You can’t perform that action at this time.
0 commit comments