mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
Disable sql requests printing
This commit is contained in:
@@ -8,7 +8,7 @@ DATABASE_URL = Env.get_strict("SQLALCHEMY_DATABASE_URL", str)
|
|||||||
# DATABASE_URL = "postgresql://user:password@postgresserver/db"
|
# DATABASE_URL = "postgresql://user:password@postgresserver/db"
|
||||||
|
|
||||||
engine = create_async_engine(
|
engine = create_async_engine(
|
||||||
DATABASE_URL, connect_args={"check_same_thread": False}, echo=True
|
DATABASE_URL, connect_args={"check_same_thread": False} # , echo=True
|
||||||
)
|
)
|
||||||
async_session = sessionmaker( # type: ignore
|
async_session = sessionmaker( # type: ignore
|
||||||
engine, class_=AsyncSession, expire_on_commit=False) # type: ignore
|
engine, class_=AsyncSession, expire_on_commit=False) # type: ignore
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ async def get_user(token: str = Depends(oauth2_scheme),
|
|||||||
print(e)
|
print(e)
|
||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
user = await db.get_user(db_session, token_data.username)
|
user = await db.get_user(db_session, token_data.username)
|
||||||
print(user)
|
|
||||||
if user is None:
|
if user is None:
|
||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
return user
|
return user
|
||||||
|
|||||||
Reference in New Issue
Block a user