Skip to content

Commit

Permalink
feat: domjudge_api_clarifications
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 committed May 26, 2023
1 parent 5d3e385 commit 363a25a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions domjudge_utility/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ def dump_domjudge_api(self):
self.submissions = self.request_json_and_save(
'submissions', 'submissions.json')

self.clarifications = self.request_json_and_save(
'clarifications', 'clarifications.json')
if self.config.exported_data.domjudge_api_clarifications:
self.clarifications = self.request_json_and_save(
'clarifications', 'clarifications.json')

if self.config.exported_data.event_feed:
self.event_feed = self.request_json_and_save(
Expand Down Expand Up @@ -645,6 +646,7 @@ def dump(self):

def load_domjudge_api(self):
self.config.exported_data.domjudge_api = False
self.config.exported_data.domjudge_api_clarifications = False

self.init_logging()
self.dump_domjudge_api()
Expand Down
3 changes: 3 additions & 0 deletions domjudge_utility/dump_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def __init__(self, exported_data_dict):
self.domjudge_api = DumpConfig.get_config_with_default_value(
exported_data_dict, 'domjudge_api', True)

self.domjudge_api_clarifications = DumpConfig.get_config_with_default_value(
exported_data_dict, "domjudge_api_clarifications", False)

# Since the export of event-feed may be a bit slow
# we do not export by default
self.event_feed = DumpConfig.get_config_with_default_value(
Expand Down

0 comments on commit 363a25a

Please sign in to comment.