diff options
Diffstat (limited to 'famille.py')
| -rw-r--r-- | famille.py | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -28,11 +28,10 @@ def shortify(string): return string @app.template_filter('format_date') -def format_date(datetime_string, format=u"%a %d %b %Y à %Hh%M".encode("utf8")): - if not datetime_string: +def format_date(date_object, format=u"%a %d %b %Y à %Hh%M".encode("utf8")): + if not date_object: return "" - return datetime.strptime(datetime_string[:-1], - "%Y-%m-%dT%H:%M:%S").strftime(format).decode("utf8") + return date_object.strftime(format).decode("utf8") @app.template_filter('pluralize') def pluralize(word, count, plural=None): @@ -190,8 +189,7 @@ def login(): session['user_name'] = user['user_name'] session['user_id'] = user['id'] g.db.execute("UPDATE users SET last_seen=? WHERE id=?", - (datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"), - session['user_id'])) + (datetime.utcnow(),session['user_id'])) g.db.commit() return redirect(url_for('list_news')) else: |
