aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2018-11-19 15:56:59 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2018-11-19 15:56:59 -0500
commit73ed2cfa3f4e38365e93d68325a0a5314104be2c (patch)
tree2e0c7d07dbe0f35dd42824ad03da9a008ffff7f0
parentf0aa25926ffffffcd1df6248b6179220a7c039a8 (diff)
downloadfamille-flask-73ed2cfa3f4e38365e93d68325a0a5314104be2c.tar.gz
actually display error message
-rw-r--r--famille.py2
-rw-r--r--templates/user/edit.html11
2 files changed, 12 insertions, 1 deletions
diff --git a/famille.py b/famille.py
index 88238fe..9656ae3 100644
--- a/famille.py
+++ b/famille.py
@@ -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>