Skip to content

Commit bece151

Browse files
committed
refactor: move get_community_by_username to orm module and update session type annotation
1 parent dd382ef commit bece151

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/routers/authentication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from app.services import auth
88
from app.schemas import Token, TokenPayload, Community
99
from app.services.database.models import Community as DBCommunity
10-
from app.services.database.community import get_community_by_username
10+
from services.database.orm.community import get_community_by_username
1111

1212
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/authentication/token")
1313

@@ -31,7 +31,7 @@ async def create_community(request: Request ):
3131
password = "123Asd!@#"
3232
hashed_password=auth.hash_password(password)
3333
community = DBCommunity(username="username", email="username@test.com", password=hashed_password)
34-
session = request.app.db_session_factory
34+
session: AsyncSession = request.app.db_session_factory
3535
session.add(community)
3636
await session.commit()
3737
await session.refresh(community)

0 commit comments

Comments
 (0)