Allow organizers to submit payment forms

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-02-29 23:05:41 +01:00
parent 6b7b802d14
commit f9645b016a
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 2 deletions

View File

@ -480,8 +480,8 @@ class PaymentUpdateView(LoginRequiredMixin, UpdateView):
if self.request.user.registration.participates:
if old_instance.valid is not False:
raise PermissionDenied(_("This payment is already valid or pending validation."))
else:
form.instance.valid = None
if old_instance.valid is False:
form.instance.valid = None
if old_instance.receipt:
old_instance.receipt.delete()
old_instance.save()