Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cmscontrib/ImportContest.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,6 @@ def _participation_to_db(
.filter(Participation.contest_id == contest.id)
.first()
)
# FIXME: detect if some details of the participation have been updated
# and thus the existing participation needs to be changed.
if p is not None:
logger.warning("Participation of user %s in this contest already "
"exists, not updating it.", new_p["username"])
return p

# Prepare new participation
args = {
Expand All @@ -319,6 +313,11 @@ def _participation_to_db(
if "delay" in new_p:
args["delay_time"] = datetime.timedelta(seconds=new_p["delay"])

if p is not None:
for k, v in args.items():
setattr(p, k, v)
return p

new_p = Participation(**args)
session.add(new_p)
return new_p
Expand Down
Loading