fix!: removed .commit() from repository level
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from db.models import User
|
||||
from db.session import UnitOfWork
|
||||
from repositories.users import UserRepository
|
||||
from schemas.jwt import ServiceJWTPayload
|
||||
|
||||
|
||||
async def fetch_subject_from_service(
|
||||
payload: ServiceJWTPayload, session: AsyncSession
|
||||
) -> User | None:
|
||||
repo = UserRepository(session)
|
||||
async def fetch_subject_from_service(payload: ServiceJWTPayload, uow: UnitOfWork) -> User | None:
|
||||
repo = UserRepository(uow)
|
||||
|
||||
if payload.acting_as.startswith("telegram:"):
|
||||
telegram_id = int(payload.acting_as.split("telegram:")[1])
|
||||
|
||||
Reference in New Issue
Block a user