black format
This commit is contained in:
parent
86f0847514
commit
9000606581
3 changed files with 17 additions and 4 deletions
|
@ -34,11 +34,20 @@ class Rss:
|
||||||
.order_by(-Comment.published)
|
.order_by(-Comment.published)
|
||||||
.limit(10)
|
.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(
|
items.append(
|
||||||
PyRSS2Gen.RSSItem(
|
PyRSS2Gen.RSSItem(
|
||||||
title="%s - %s://%s%s"
|
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,
|
link=item_link,
|
||||||
description=md.convert(row.content),
|
description=md.convert(row.content),
|
||||||
guid=PyRSS2Gen.Guid("%s/%d" % (item_link, row.id)),
|
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)))
|
.where((Comment.url == url) & (Comment.published.is_null(False)))
|
||||||
.count()
|
.count()
|
||||||
if url
|
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"])
|
@app.route("/web/admin", methods=["GET"])
|
||||||
def admin_homepage():
|
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
|
# TODO localization
|
||||||
flash("Vous avez été déconnecté.")
|
flash("Vous avez été déconnecté.")
|
||||||
return redirect("/web/login")
|
return redirect("/web/login")
|
||||||
|
|
Loading…
Add table
Reference in a new issue