diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2012-11-08 22:28:10 +0100 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2012-11-08 22:28:10 +0100 |
| commit | ea39366c947bcc2e9234a50d79e13e472abd9736 (patch) | |
| tree | 9cce168e58115072d7b39e9e36d96dd3c5da0c7a | |
| parent | 8ab3ac64902e3216feaf6333a6ab93a0175b8b51 (diff) | |
| download | famille-flask-ea39366c947bcc2e9234a50d79e13e472abd9736.tar.gz | |
Forgot to take Guillaume's remark into account in previous commit
| -rw-r--r-- | famille.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -28,13 +28,13 @@ def format_date(datetime_string, format=u"%a %d %b %Y à %Hh%M".encode("utf8")): @app.template_filter('pluralize') def pluralize(word, count, plural=None): if count == 0: - return "Aucun {}".format(word) + return "Aucun {0}".format(word) elif count == 1: - return "1 {}".format(word) + return "1 {0}".format(word) elif plural: - return "{} {}".format(count, plural) + return "{0} {1}".format(count, plural) else: - return "{} {}s".format(count, word) + return "{0} {1}s".format(count, word) def query_db(query, args=(), one=False): cur = g.db.execute(query, args) @@ -142,7 +142,7 @@ def edit_user(): result = {} try: if request.form['password'] == request.form['password_confirm']: - result['password'] =hashlib.md5(request.form['password']).hexdigest() + result['password'] = hashlib.md5(request.form['password']).hexdigest() else: error = u"Les deux mots de passe ne coïncident pas" return render_template("user/edit.html", user=request.form, @@ -153,7 +153,7 @@ def edit_user(): for key in ['email', 'phone', 'birthday', 'nameday', 'address_line1', 'address_line2', 'address_city_line']: result[key] = request.form[key].encode("utf8") - set_string = ",".join("'{}'='{}'".format(key, value) + set_string = ",".join("'{0}'='{1}'".format(key, value) for key,value in result.iteritems()) print set_string g.db.execute("UPDATE users SET {} where id=?".format(set_string), |
