From 8c819350046fa92a185ec19f8cfa4e076c4d8b34 Mon Sep 17 00:00:00 2001 From: DmitryGantimurov Date: Thu, 27 Jul 2023 23:22:24 +0300 Subject: [PATCH] create new user without passw., id in create_user --- back/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/back/main.py b/back/main.py index 23d3248..62bc357 100644 --- a/back/main.py +++ b/back/main.py @@ -180,8 +180,8 @@ def change_book_status(data: schemas.Book): @app.post("/api/signup") def create_user(data = Body()): if database.query(UserDatabase).filter(UserDatabase.email == data["email"]).first() == None: - new_user = UserDatabase(id=data["id"], email=data["email"], password=data["password"], - hashed_password=get_password_hash(data["password"]), name=data["name"], surname=data["surname"]) + new_user = UserDatabase(email=data["email"], hashed_password=get_password_hash(data["password"]), + name=data["name"], surname=data["surname"]) database.add(new_user) database.commit() database.refresh(new_user) # обновляем состояние объекта