File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -296,12 +296,6 @@ def _participation_to_db(
296296 .filter (Participation .contest_id == contest .id )
297297 .first ()
298298 )
299- # FIXME: detect if some details of the participation have been updated
300- # and thus the existing participation needs to be changed.
301- if p is not None :
302- logger .warning ("Participation of user %s in this contest already "
303- "exists, not updating it." , new_p ["username" ])
304- return p
305299
306300 # Prepare new participation
307301 args = {
@@ -319,6 +313,11 @@ def _participation_to_db(
319313 if "delay" in new_p :
320314 args ["delay_time" ] = datetime .timedelta (seconds = new_p ["delay" ])
321315
316+ if p is not None :
317+ for k , v in args .items ():
318+ setattr (p , k , v )
319+ return p
320+
322321 new_p = Participation (** args )
323322 session .add (new_p )
324323 return new_p
You can’t perform that action at this time.
0 commit comments