Browse Source
✏ Fix typo in variable names in `backend/app/api/routes/items.py` and `backend/app/api/routes/users.py` (#711)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
pull/13907/head
Salomon Popp
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
6 deletions
-
backend/app/api/routes/items.py
-
backend/app/api/routes/users.py
|
|
@ -18,17 +18,17 @@ def read_items( |
|
|
|
""" |
|
|
|
|
|
|
|
if current_user.is_superuser: |
|
|
|
statment = select(func.count()).select_from(Item) |
|
|
|
count = session.exec(statment).one() |
|
|
|
count_statement = select(func.count()).select_from(Item) |
|
|
|
count = session.exec(count_statement).one() |
|
|
|
statement = select(Item).offset(skip).limit(limit) |
|
|
|
items = session.exec(statement).all() |
|
|
|
else: |
|
|
|
statment = ( |
|
|
|
count_statement = ( |
|
|
|
select(func.count()) |
|
|
|
.select_from(Item) |
|
|
|
.where(Item.owner_id == current_user.id) |
|
|
|
) |
|
|
|
count = session.exec(statment).one() |
|
|
|
count = session.exec(count_statement).one() |
|
|
|
statement = ( |
|
|
|
select(Item) |
|
|
|
.where(Item.owner_id == current_user.id) |
|
|
|
|
|
@ -36,8 +36,8 @@ def read_users(session: SessionDep, skip: int = 0, limit: int = 100) -> Any: |
|
|
|
Retrieve users. |
|
|
|
""" |
|
|
|
|
|
|
|
statment = select(func.count()).select_from(User) |
|
|
|
count = session.exec(statment).one() |
|
|
|
count_statement = select(func.count()).select_from(User) |
|
|
|
count = session.exec(count_statement).one() |
|
|
|
|
|
|
|
statement = select(User).offset(skip).limit(limit) |
|
|
|
users = session.exec(statement).all() |
|
|
|