apply pyupgrade

This commit is contained in:
David Lord 2020-04-04 09:43:06 -07:00
parent 57d628ca74
commit 524fd0bc8c
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
54 changed files with 169 additions and 230 deletions

View file

@ -64,7 +64,7 @@ def register():
db.execute("SELECT id FROM user WHERE username = ?", (username,)).fetchone()
is not None
):
error = "User {0} is already registered.".format(username)
error = f"User {username} is already registered."
if error is None:
# the name is available, store it in the database and go to

View file

@ -49,7 +49,7 @@ def get_post(id, check_author=True):
)
if post is None:
abort(404, "Post id {0} doesn't exist.".format(id))
abort(404, f"Post id {id} doesn't exist.")
if check_author and post["author_id"] != g.user["id"]:
abort(403)