diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2018-11-19 15:56:59 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2018-11-19 15:56:59 -0500 |
| commit | 73ed2cfa3f4e38365e93d68325a0a5314104be2c (patch) | |
| tree | 2e0c7d07dbe0f35dd42824ad03da9a008ffff7f0 | |
| parent | f0aa25926ffffffcd1df6248b6179220a7c039a8 (diff) | |
| download | famille-flask-73ed2cfa3f4e38365e93d68325a0a5314104be2c.tar.gz | |
actually display error message
| -rw-r--r-- | famille.py | 2 | ||||
| -rw-r--r-- | templates/user/edit.html | 11 |
2 files changed, 12 insertions, 1 deletions
@@ -262,7 +262,7 @@ def edit_user(): md5(request.form['password'].encode()). hexdigest()) else: - error = "Les deux mots de passe ne coïncident pas" + flash("Les deux mots de passe ne coïncident pas") return render_template("user/edit.html", user=request.form, timezones=pytz.common_timezones) except KeyError: diff --git a/templates/user/edit.html b/templates/user/edit.html index 95b0323..1797a5a 100644 --- a/templates/user/edit.html +++ b/templates/user/edit.html @@ -35,6 +35,17 @@ <input type="checkbox" name="notify" id="notify" {% if user.notify %}checked="checked"{% endif %} style="text-align:left"/> </div> </div> + {% with messages = get_flashed_messages() %} + {% if messages %} + {% for message in messages %} + <div class="alert alert-danger" role="alert"> + <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"> + </span> + {{message}} + </div> + {% endfor %} + {% endif %} + {% endwith %} </fieldset> <fieldset> |
