black format

pull/8/head
Yax 2 years ago
parent 86f0847514
commit 9000606581

@ -34,11 +34,20 @@ class Rss:
.order_by(-Comment.published)
.limit(10)
):
item_link = "%s://%s%s" % (self._rss_proto, self._site_url, row.url)
item_link = "%s://%s%s" % (
self._rss_proto,
self._site_url,
row.url,
)
items.append(
PyRSS2Gen.RSSItem(
title="%s - %s://%s%s"
% (self._rss_proto, row.author_name, self._site_url, row.url),
% (
self._rss_proto,
row.author_name,
self._site_url,
row.url,
),
link=item_link,
description=md.convert(row.content),
guid=PyRSS2Gen.Guid("%s/%d" % (item_link, row.id)),

@ -47,7 +47,9 @@ def count_published_comments(url):
.where((Comment.url == url) & (Comment.published.is_null(False)))
.count()
if url
else Comment.select(Comment).where(Comment.published.is_null(False)).count()
else Comment.select(Comment)
.where(Comment.published.is_null(False))
.count()
)

@ -51,7 +51,9 @@ def logout():
@app.route("/web/admin", methods=["GET"])
def admin_homepage():
if not ("user" in session and session["user"] == app.config.get("WEB_USERNAME")):
if not (
"user" in session and session["user"] == app.config.get("WEB_USERNAME")
):
# TODO localization
flash("Vous avez été déconnecté.")
return redirect("/web/login")

Loading…
Cancel
Save