From d0298c64920b5cc7a2e4c6006fa5a6a1bb9a2a67 Mon Sep 17 00:00:00 2001 From: Justin Hsieh <41461549+justin-hsieh@users.noreply.github.com> Date: Thu, 12 Oct 2023 07:57:29 -0700 Subject: [PATCH] Update functions.py --- fantasy_app/functions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fantasy_app/functions.py b/fantasy_app/functions.py index f367ac4..2d336b6 100644 --- a/fantasy_app/functions.py +++ b/fantasy_app/functions.py @@ -170,6 +170,10 @@ def get_most_position_points(position, currentweek=0): def order_positions_by_points(score_list): sorted_list = sorted(score_list, key=operator.itemgetter( 'total_score'), reverse=True) + + for i, member_dict in enumerate(sorted_list): + member_dict["rank"] = i + 1 + # member_dict["rank"] = position + 1 return sorted_list