Skip to content

Instantly share code, notes, and snippets.

@alimuradov
Created January 11, 2022 07:42
Show Gist options
  • Save alimuradov/3eedb58903d408ccfa7c41bc970aee53 to your computer and use it in GitHub Desktop.
Save alimuradov/3eedb58903d408ccfa7c41bc970aee53 to your computer and use it in GitHub Desktop.
Что со мной не так??
def stock_list_by_store(db: Session, storeId):
stocks_list= db.query(Stock).filter(Stock.storeId == storeId).all()
return stocks_list
@router.get("/{storeId}/stocks", response_model=StocksList, status_code=status.HTTP_200_OK, summary="Получение остатков по аптеке")
async def get_stocks(
db: Session = Depends(get_db),
current_user: User = Depends(get_current_active_user),
storeId: UUID4 = None
):
if not current_user:
raise HTTPException(status_code=403, detail="Вы не авторизованы. Проверьте авторизационный токен")
if not storeId == current_user.store.storeId:
raise HTTPException(status_code=403, detail="У вас нет прав на выполнение данной операции")
stocks_by_store = stock_list_by_store(db, storeId)
return stocks_by_store
Ответ такой...
esponse -> __root__ -> 9382
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9383
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9384
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9385
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9386
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9387
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9388
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9389
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9390
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9391
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9392
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9393
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9394
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9395
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9396
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9397
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9398
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9399
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9400
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9401
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9402
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9403
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9404
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9405
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9406
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9407
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9408
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9409
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9410
value is not a valid dict (type=type_error.dict)
response -> __root__ -> 9411
value is not a valid dict (type=type_error.dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment