feat: add import

This commit is contained in:
2026-06-04 18:09:06 +03:00
parent 62a48c3f70
commit aabea07293
8 changed files with 21 additions and 19 deletions

View File

@@ -22,7 +22,7 @@ class AdminUserRepository(IAdminUserRepository):
def _to_entity(self, m: AdminUserModel) -> AdminUserEntity:
return AdminUserEntity(
id=m.id,
email=m.email,
login=m.login,
password_hash=m.password_hash,
first_name=m.first_name,
last_name=m.last_name,
@@ -33,9 +33,9 @@ class AdminUserRepository(IAdminUserRepository):
updated_at=m.updated_at,
)
async def get_by_email(self, email: str) -> AdminUserEntity:
async def get_by_login(self, login: str) -> AdminUserEntity:
try:
stmt = select(AdminUserModel).where(func.lower(AdminUserModel.email) == email.lower())
stmt = select(AdminUserModel).where(func.lower(AdminUserModel.login) == login.lower())
result = await self._session.execute(stmt)
user = result.scalar_one_or_none()
if user is None: