Skip to content

Commit

Permalink
--from-contest also creates fields color, author, preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
cip999 committed Jan 15, 2023
1 parent eb45164 commit 566c9b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p2d/p2d_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ def fill_config_from_contest(config, contest_id):
config_problem = [p for p in config['problems'] if p['polygon_id'] == problem['id']][0]
if 'label' not in config_problem:
config_problem['label'] = label
if 'color' not in config_problem:
config_problem['color'] = 'Black'
for field in ['author', 'preparation']:
if field not in config_problem:
config_problem['field'] = ''

if len(new_problems) > 0:
logger.info('Found new problems: {}.'.format(', '.join(new_problems)))
Expand Down

0 comments on commit 566c9b3

Please sign in to comment.