👷 Run mypy by pre-commit (#2169)

This commit is contained in:
Motov Yurii
2026-02-03 21:28:50 +03:00
committed by GitHub
parent 7af1d80593
commit 8b35efe999
4 changed files with 15 additions and 5 deletions

View File

@@ -42,7 +42,9 @@ def read_users(session: SessionDep, skip: int = 0, limit: int = 100) -> Any:
count_statement = select(func.count()).select_from(User)
count = session.exec(count_statement).one()
statement = select(User).order_by(User.created_at.desc()).offset(skip).limit(limit)
statement = (
select(User).order_by(col(User.created_at).desc()).offset(skip).limit(limit)
)
users = session.exec(statement).all()
return UsersPublic(data=users, count=count)
@@ -223,7 +225,7 @@ def delete_user(
status_code=403, detail="Super users are not allowed to delete themselves"
)
statement = delete(Item).where(col(Item.owner_id) == user_id)
session.exec(statement) # type: ignore
session.exec(statement)
session.delete(user)
session.commit()
return Message(message="User deleted successfully")