Update main.py
Browse files
main.py
CHANGED
@@ -42,9 +42,13 @@ async def register_get(request: Request):
|
|
42 |
@app.post("/register", response_class=HTMLResponse)
|
43 |
async def register_post(
|
44 |
request: Request,
|
45 |
-
|
|
|
|
|
|
|
46 |
db: Session = Depends(get_db)
|
47 |
):
|
|
|
48 |
registered_user = register(user, db)
|
49 |
return RedirectResponse("/registration_successful")
|
50 |
|
|
|
42 |
@app.post("/register", response_class=HTMLResponse)
|
43 |
async def register_post(
|
44 |
request: Request,
|
45 |
+
username: str = Form(...),
|
46 |
+
email: str = Form(...),
|
47 |
+
password: str = Form(...),
|
48 |
+
confirm_password: str = Form(...),
|
49 |
db: Session = Depends(get_db)
|
50 |
):
|
51 |
+
user = UserCreate(username=username, email=email, password=password, confirm_password=confirm_password)
|
52 |
registered_user = register(user, db)
|
53 |
return RedirectResponse("/registration_successful")
|
54 |
|