@@ -21,12 +21,10 @@ def get_answer_for_user(context, userid):
2121
2222def upsert_answer (context , userid , display_name , selected_dates ):
2323 """Create or replace a user's answer."""
24- normalized = sorted (
25- {
26- value .isoformat () if isinstance (value , date ) else value
27- for value in selected_dates
28- }
29- )
24+ normalized = sorted ({
25+ value .isoformat () if isinstance (value , date ) else value
26+ for value in selected_dates
27+ })
3028 annotations = IAnnotations (context )
3129 answers = list (annotations .get (ANSWERS_KEY , []))
3230 for entry in answers :
@@ -35,13 +33,11 @@ def upsert_answer(context, userid, display_name, selected_dates):
3533 entry ["selected_dates" ] = normalized
3634 annotations [ANSWERS_KEY ] = answers
3735 return
38- answers .append (
39- {
40- "userid" : userid ,
41- "display_name" : display_name ,
42- "selected_dates" : normalized ,
43- }
44- )
36+ answers .append ({
37+ "userid" : userid ,
38+ "display_name" : display_name ,
39+ "selected_dates" : normalized ,
40+ })
4541 annotations [ANSWERS_KEY ] = answers
4642
4743
@@ -62,12 +58,10 @@ def build_results(context):
6258 for candidate in candidate_dates :
6359 iso = candidate .isoformat ()
6460 info = by_date [iso ]
65- rows .append (
66- {
67- "date" : candidate ,
68- "iso" : iso ,
69- "count" : info ["count" ],
70- "names" : info ["names" ],
71- }
72- )
61+ rows .append ({
62+ "date" : candidate ,
63+ "iso" : iso ,
64+ "count" : info ["count" ],
65+ "names" : info ["names" ],
66+ })
7367 return rows
0 commit comments