From 0566c43e271d5b3747b266d8905dc1e07d5e6000 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 13 Apr 2024 22:56:24 +0200 Subject: [PATCH] Fixnute prenahravanie rieseni --- competition/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/competition/views.py b/competition/views.py index ef878cd..44049bd 100644 --- a/competition/views.py +++ b/competition/views.py @@ -270,8 +270,11 @@ def upload_solution(self, request, pk=None): if len(existing_solutions) > 0 and late_tag is not None and not late_tag.can_resubmit: raise exceptions.ValidationError( detail='Túto úlohu už nie je možné odovzdať znova.') + for solution in existing_solutions: + solution.solution.delete() Solution.objects.filter( problem=problem, semester_registration=event_registration).delete() + solution = Solution.objects.create( problem=problem, semester_registration=event_registration,