Skip to content

Commit

Permalink
Merge pull request #834 from DH-IT-Portal-Development/fix/submit_vali…
Browse files Browse the repository at this point in the history
…dation_bug

fix: avoid double validation of submit form
  • Loading branch information
EdoStorm96 authored Jan 8, 2025
2 parents 300591d + e8b9e3a commit de1d912
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions proposals/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,14 @@ def clean(self):
from proposals.utils.stepper import Stepper

validator = Stepper(self.instance, request=self.request)
# And then we append stepper errors to show them to the user
# on the submit page
if validator.get_form_errors():

form_errors = validator.get_form_errors()

if form_errors:
# If there are only errors on the submit form, we override this
# validation. Otherwise saving the updated data becomes impossible
if len(form_errors) == 1 and "proposals/submit" in form_errors[0]["url"]:
return
self.add_error(
None,
_("Aanvraag bevat nog foutmeldingen"),
Expand Down

0 comments on commit de1d912

Please sign in to comment.