{# -*- mode: web; -*- #} {% extends "base.html" %} {% block title %}Add a new invoice{% endblock %} {% block content %} {% if message %} {# the form was submitted and message exists #}
{{ item }}
{# links #} {% else %} {# the form is displayed when template opens via GET not POST #} {# show flash - based on WTForms validators see https://pythonprogramming.net/flash-flask-tutorial/ get_flashed_messages() exists here because of flash() in the route function #} {% with errors = get_flashed_messages() %} {% if errors %} {% for err in errors %}