mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 20:36:27 +00:00
🎨 Bring Python code into compliance with Black and Flake8 (#121)
* Ignore Flake8 unused import error F401 https://flake8.readthedocs.io/en/latest/user/error-codes.html The apparently unused imports may be needed for SQLAlchemy. As the code comment says: make sure all SQL Alchemy models are imported before initializing DB otherwise, SQL Alchemy might fail to initialize properly relationships See GitHub 28 and 29 * Ignore Flake8 unused variable error F841 https://flake8.readthedocs.io/en/latest/user/error-codes.html The apparently unused variables may be needed for tests. * Bring line length into compliance with Black Should be 88 characters. * Format alembic code with Black
This commit is contained in:
@@ -5,7 +5,7 @@ from app.schemas.user import UserCreate
|
||||
# make sure all SQL Alchemy models are imported before initializing DB
|
||||
# otherwise, SQL Alchemy might fail to initialize relationships properly
|
||||
# for more details: https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/28
|
||||
from app.db import base
|
||||
from app.db import base # noqa: F401
|
||||
|
||||
|
||||
def init_db(db_session):
|
||||
@@ -21,4 +21,4 @@ def init_db(db_session):
|
||||
password=settings.FIRST_SUPERUSER_PASSWORD,
|
||||
is_superuser=True,
|
||||
)
|
||||
user = crud.user.create(db_session, obj_in=user_in)
|
||||
user = crud.user.create(db_session, obj_in=user_in) # noqa: F841
|
||||
|
||||
Reference in New Issue
Block a user