forked from orbit-oss/flask
apply pyupgrade
This commit is contained in:
parent
57d628ca74
commit
524fd0bc8c
54 changed files with 169 additions and 230 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import io
|
||||
|
||||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
with io.open("README.rst", "rt", encoding="utf8") as f:
|
||||
with open("README.rst", encoding="utf8") as f:
|
||||
readme = f.read()
|
||||
|
||||
setup(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ def runner(app):
|
|||
return app.test_cli_runner()
|
||||
|
||||
|
||||
class AuthActions(object):
|
||||
class AuthActions:
|
||||
def __init__(self, client):
|
||||
self._client = client
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def test_get_close_db(app):
|
|||
|
||||
|
||||
def test_init_db_command(runner, monkeypatch):
|
||||
class Recorder(object):
|
||||
class Recorder:
|
||||
called = False
|
||||
|
||||
def fake_init_db():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue