-
-
Save calpaterson/9025144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route("/claims/new-employment-end-date", methods=["POST"]) | |
def new_employment_end_date(): | |
def on_success(validated): | |
draft_id = session.get('draft_id') | |
day = validated['new_job_end']['day'] | |
month = validated['new_job_end']['month'] | |
year = validated['new_job_end']['year'] | |
date = "{day}/{month}/{year}".format(**locals()) | |
claim_service.update_draft(draft_id, { | |
"new_job_end_date": date | |
}) | |
return redirect('/claims/summary') | |
def on_error(form_data, errors): | |
return render_template("new_employment_end_date.html", form_data=form_data, errors=errors) | |
return validate(schemas.NewEmploymentEndDate(), on_success, on_error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment