Skip to content

Commit 6bcdf71

Browse files
Don't recreate participations when updating a contest while importing
If we do, we lose all submissions and other participation-tied objects. Fixes #775 for the v1.3 branch.
1 parent cf5b096 commit 6bcdf71

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmscontrib/ImportContest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ def do_import(self):
102102
if old_contest is not None:
103103
if self.update_contest:
104104
if contest_has_changed:
105-
self._update_object(old_contest, contest)
105+
# Participations are handled later, so we ignore them
106+
# at this point (note that contest does not even have
107+
# participations). Tasks can be ignored or not, since
108+
# they can live even detached from a contest.
109+
self._update_object(old_contest, contest,
110+
ignore={"participations"})
106111
contest = old_contest
107112
elif self.update_tasks:
108113
contest = old_contest

0 commit comments

Comments
 (0)