добавлен параметр response_model к get_user
This commit is contained in:
parent
9e4bb1b99f
commit
6127dd8ba4
@ -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()
|
user_with_required_email = db.query(UserDatabase).filter(UserDatabase.email == email).one()
|
||||||
if user_with_required_email:
|
if user_with_required_email:
|
||||||
return user_with_required_email
|
return UserInDB(user_with_required_email)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user