Skip to content

Instantly share code, notes, and snippets.

@molszewski
Created February 15, 2014 14:42
Show Gist options
  • Save molszewski/9020179 to your computer and use it in GitHub Desktop.
Save molszewski/9020179 to your computer and use it in GitHub Desktop.
@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