mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 20:02:49 +02:00
Upload to the good place
This commit is contained in:
@ -456,11 +456,10 @@ class SolutionUploadView(LoginRequiredMixin, FormView):
|
||||
"""
|
||||
form_sol = form.instance
|
||||
# Drop previous solution if existing
|
||||
Solution.objects.filter(
|
||||
participation=self.participation,
|
||||
problem=form_sol.problem,
|
||||
final_solution=self.participation.final,
|
||||
).delete()
|
||||
for sol in Solution.objects.filter(participation=self.participation,
|
||||
problem=form_sol.problem,
|
||||
final_solution=self.participation.final).all():
|
||||
sol.delete()
|
||||
form_sol.participation = self.participation
|
||||
form_sol.final = self.participation.final
|
||||
form_sol.save()
|
||||
|
Reference in New Issue
Block a user