f-strings everywhere

This commit is contained in:
David Lord 2020-04-04 11:39:03 -07:00
parent 524fd0bc8c
commit 2ae740dd49
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
35 changed files with 227 additions and 245 deletions

View file

@ -207,7 +207,7 @@ it from each view.
).fetchone()
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)

View file

@ -94,7 +94,7 @@ write templates to generate the HTML form.
elif db.execute(
'SELECT id FROM user WHERE username = ?', (username,)
).fetchone() is not None:
error = 'User {} is already registered.'.format(username)
error = f"User {username} is already registered."
if error is None:
db.execute(