File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,19 @@ def get_api():
53
53
54
54
55
55
def get_contest_id ():
56
- if config .args .contest_id :
57
- return config .args .contest_id
58
- if 'contest_id' in contest_yaml ():
59
- return contest_yaml ()['contest_id' ]
56
+ contest_id = (
57
+ config .args .contest_id
58
+ if config .args .contest_id
59
+ else contest_yaml ()['contest_id' ] if 'contest_id' in contest_yaml () else None
60
+ )
60
61
contests = get_contests ()
62
+ if contest_id is not None :
63
+ if contest_id not in {c ['id' ] for c in contests }:
64
+ for contest in contests :
65
+ log (f'{ contest ["id" ]} : { contest ["name" ]} ' )
66
+ fatal (f'Contest { contest_id } not found.' )
67
+ else :
68
+ return contest_id
61
69
if len (contests ) > 1 :
62
70
for contest in contests :
63
71
log (f'{ contest ["id" ]} : { contest ["name" ]} ' )
You can’t perform that action at this time.
0 commit comments