mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 06:22:22 +00:00
Fix solution upload
This commit is contained in:
parent
e21c3bb413
commit
9a1006b341
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user