From 9a1006b34150e195d401f9d0d80e22a82a8f0f1b Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 9 May 2021 10:40:45 +0200 Subject: [PATCH] Fix solution upload --- apps/participation/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/participation/views.py b/apps/participation/views.py index 9c65aa9..95b3a52 100644 --- a/apps/participation/views.py +++ b/apps/participation/views.py @@ -564,6 +564,7 @@ class SolutionUploadView(LoginRequiredMixin, FormView): return self.handle_no_permission() return super().dispatch(request, *args, **kwargs) + @transaction.atomic def form_valid(self, form): """ When a solution is submitted, it replaces a previous solution if existing, @@ -586,7 +587,7 @@ class SolutionUploadView(LoginRequiredMixin, FormView): sol.save() sol.delete() form_sol.participation = self.participation - form_sol.final = self.participation.final + form_sol.final_solution = self.participation.final form_sol.save() return super().form_valid(form)