File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,21 +45,18 @@ def main_menu():
4545def get_parts ():
4646 online_participants_ids = get_participants () # Replace with your function to fetch participants
4747 all_participants = get_participants_for_view ()
48- # participants = None
49- # if not participants:
50- # participants = PARTICIPANTS
5148
52- if len (online_participants_ids ) > 0 and not isinstance ( online_participants_ids [ 0 ], dict ) :
49+ if len (online_participants_ids ) > 0 and all_participants :
5350 # make every id in the list, from a '003' to '3'
5451 online_participants_ids = [int (x ) for x in online_participants_ids ]
5552
5653 online_participants = []
5754 for part in all_participants :
58- # convert from string to dict
5955 part = json .loads (part )
6056 if part ['pid' ] in online_participants_ids :
57+ part ['id' ] = str (part ['pid' ]).zfill (3 )
6158 online_participants .append (part )
62-
59+ print ( f"online_participants: { online_participants } " )
6360 return jsonify (online_participants )
6461 return jsonify (all_participants )
6562
You can’t perform that action at this time.
0 commit comments