black default setting: line length is 88 chars max
This commit is contained in:
parent
b90e50e3d5
commit
470155345f
4 changed files with 8 additions and 13 deletions
2
Makefile
2
Makefile
|
@ -10,4 +10,4 @@ lint:
|
||||||
pylint stacosys/
|
pylint stacosys/
|
||||||
|
|
||||||
black:
|
black:
|
||||||
black -l 79 stacosys/
|
black stacosys/
|
|
@ -47,9 +47,7 @@ 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)
|
else Comment.select(Comment).where(Comment.published.is_null(False)).count()
|
||||||
.where(Comment.published.is_null(False))
|
|
||||||
.count()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,7 @@ def logout():
|
||||||
|
|
||||||
@app.route("/web/admin", methods=["GET"])
|
@app.route("/web/admin", methods=["GET"])
|
||||||
def admin_homepage():
|
def admin_homepage():
|
||||||
if not (
|
if not ("user" in session and session["user"] == app.config.get("WEB_USERNAME")):
|
||||||
"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")
|
||||||
|
|
|
@ -20,12 +20,11 @@ from stacosys.interface.web import admin
|
||||||
def configure_logging(level):
|
def configure_logging(level):
|
||||||
root_logger = logging.getLogger()
|
root_logger = logging.getLogger()
|
||||||
root_logger.setLevel(level)
|
root_logger.setLevel(level)
|
||||||
ch = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
ch.setLevel(level)
|
handler.setLevel(level)
|
||||||
formatter = logging.Formatter(
|
formatter = logging.Formatter("[%(asctime)s] %(name)s %(levelname)s %(message)s")
|
||||||
"[%(asctime)s] %(name)s %(levelname)s %(message)s")
|
handler.setFormatter(formatter)
|
||||||
ch.setFormatter(formatter)
|
root_logger.addHandler(handler)
|
||||||
root_logger.addHandler(ch)
|
|
||||||
|
|
||||||
|
|
||||||
def stacosys_server(config_pathname):
|
def stacosys_server(config_pathname):
|
||||||
|
|
Loading…
Add table
Reference in a new issue