Move UII form workaround into a form method
This commit is contained in:
parent
66eb44afdd
commit
b41cfa0955
@ -63,6 +63,12 @@ class FinancialForm(ValidatedForm):
|
|||||||
self.funding_type_other.validators.append(Required())
|
self.funding_type_other.validators.append(Required())
|
||||||
return super().validate(*args, **kwargs)
|
return super().validate(*args, **kwargs)
|
||||||
|
|
||||||
|
def reset(self):
|
||||||
|
"""
|
||||||
|
Reset UII info so that it can be de-parsed rendered properly.
|
||||||
|
This is a stupid workaround, and there's probably a better way.
|
||||||
|
"""
|
||||||
|
self.uii_ids.process_data(self.uii_ids.data)
|
||||||
|
|
||||||
def perform_extra_validation(self, existing_request):
|
def perform_extra_validation(self, existing_request):
|
||||||
valid = True
|
valid = True
|
||||||
|
@ -32,12 +32,12 @@ def update_financial_verification(request_id):
|
|||||||
if valid:
|
if valid:
|
||||||
return redirect(url_for("requests.financial_verification_submitted"))
|
return redirect(url_for("requests.financial_verification_submitted"))
|
||||||
else:
|
else:
|
||||||
# TODO: This is a horrible workaround.
|
form.reset()
|
||||||
form.uii_ids.process_data(form.uii_ids.data)
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"requests/financial_verification.html", **rerender_args
|
"requests/financial_verification.html", **rerender_args
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
form.reset()
|
||||||
return render_template("requests/financial_verification.html", **rerender_args)
|
return render_template("requests/financial_verification.html", **rerender_args)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user