добавлен параметр response_model к get_user

This commit is contained in:
DmitryGantimurov 2023-07-19 00:10:59 +03:00
parent 9e4bb1b99f
commit 6127dd8ba4

View File

@ -42,10 +42,10 @@ def get_password_hash(password):
# проблема здесь
def get_user(db: SessionLocal, email: str):
def get_user(db: SessionLocal, email: str, response_model=User):
user_with_required_email = db.query(UserDatabase).filter(UserDatabase.email == email).one()
if user_with_required_email:
return user_with_required_email
return UserInDB(user_with_required_email)
return None