Registrace, kontrola prihlaseni uzivatele ve sprave letadel

This commit is contained in:
Michal Kváček
2023-08-15 10:31:06 +02:00
parent 97295c17c0
commit 33e0a35f4b
5 changed files with 24 additions and 16 deletions
+6 -6
View File
@@ -32,13 +32,13 @@ class RegistrationEndpoint(BaseEndpoint):
if existing_user:
raise HTTPException(status_code=422, detail="User already exists")
model = User(
name=user_data.name,
email=user_data.email,
password_hashed=bcrypt.hash(user_data.password)
)
model = await User.create(self.db, {
"name": user_data.name,
"email": user_data.email,
"password_hashed": bcrypt.hash(user_data.password),
"description": ""
})
self.db.add(model)
await self.db.commit()
return model.as_dict()