diff options
Diffstat (limited to 'famille.py')
| -rw-r--r-- | famille.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -10,6 +10,8 @@ from docutils.writers.html4css1 import Writer from datetime import datetime from bs4 import BeautifulSoup from flask_mail import Mail, Message +import locale +locale.setlocale(locale.LC_ALL, 'fr_FR') def rstify(string): w = Writer() @@ -30,9 +32,10 @@ def shortify(string): return string @app.template_filter('format_date') -def format_date(date_object, format=u"%a %d %b %Y à %Hh%M".encode("utf8")): +def format_date(date_object, format=u"%a %d %b %Y à %Hh%M"): if not date_object: return "" + format = format.encode("utf8") return date_object.strftime(format).decode("utf8") @app.template_filter('pluralize') @@ -97,7 +100,7 @@ def add_news(): emails = query_db("SELECT email from users where notify=1") emails = [email["email"] for email in emails] message = Message(request.form['title'], sender="news.horel@gmail.com") - message.html = content_cache + message.body = content_cache message.recipients = emails mail.send(message) |
