diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2018-12-30 15:03:27 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2018-12-30 15:06:23 -0500 |
| commit | 5228c329b5cbaaa454f0e1c8b4d5a80a3c526bc5 (patch) | |
| tree | afd7c25f56e8220c6dfc61030ed37e15e75957f4 | |
| parent | 961b362ab35f5900cd3b3ab90a9a4082fbfdcb3c (diff) | |
| download | famille-flask-5228c329b5cbaaa454f0e1c8b4d5a80a3c526bc5.tar.gz | |
remove password update logic
| -rw-r--r-- | famille.py | 15 | ||||
| -rw-r--r-- | templates/user/edit.html | 26 |
2 files changed, 1 insertions, 40 deletions
@@ -1,9 +1,8 @@ import sqlite3 #all the imports from flask import Flask, request, session, g, redirect,\ - url_for, render_template, flash, jsonify + url_for, render_template, jsonify from functools import wraps -import hashlib from pytz import timezone import pytz from docutils import core @@ -264,18 +263,6 @@ def edit_user(): return render_template("user/edit.html", user=user, timezones=pytz.common_timezones) elif request.method == 'POST': result = {} - try: - if request.form['password'] == request.form['password_confirm']: - result['password'] = (hashlib. - md5(request.form['password'].encode()). - hexdigest()) - else: - 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: - pass - result['notify'] = "notify" in request.form for k in ["birthday", "nameday", "email", "phone", "adress_line1", "adress_line2", "adress_city_line", "timezone"]: diff --git a/templates/user/edit.html b/templates/user/edit.html index b9982db..c1204cf 100644 --- a/templates/user/edit.html +++ b/templates/user/edit.html @@ -14,38 +14,12 @@ class="form-horizontal"> <fieldset> <legend>Paramètres</legend> - <p class="info">Laisser les champs vides si vous ne souhaitez pas changer de mot de passe.</p> - <div class="form-group form-group-sm"> - <label for="password" class="col-md-4">Nouveau mot de passe :</label> - <div class="col-md-4"> - <input type="password" name="password" id="password" autocomplete="nope" - class="form-control"/> - </div> - </div> - <div class="form-group form-group-sm"> - <label for="confirm" class="col-md-4">Répéter le mot de passe :</label> - <div class="col-md-4"> - <input type="password" name="password_confirm" id="confirm" - class="form-control"/> - </div> - </div> <div class="form-group"> <label for="notify" class="col-md-4">Recevoir un mail lors<br/>d'une nouvelle actualité:</label> <div class="col-md-4"> <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> |
