Update main.py
Browse files
main.py
CHANGED
@@ -40,9 +40,14 @@ async def register_get(request: Request):
|
|
40 |
return templates.TemplateResponse("register.html", {"request": request})
|
41 |
|
42 |
@app.post("/register", response_class=HTMLResponse)
|
43 |
-
async def register_post(
|
|
|
|
|
|
|
|
|
44 |
registered_user = register(user, db)
|
45 |
return RedirectResponse("/registration_successful")
|
|
|
46 |
@app.get("/registration_successful", response_class=HTMLResponse)
|
47 |
async def registration_successful(request: Request):
|
48 |
return templates.TemplateResponse("registration_successful.html", {"request": request})
|
|
|
40 |
return templates.TemplateResponse("register.html", {"request": request})
|
41 |
|
42 |
@app.post("/register", response_class=HTMLResponse)
|
43 |
+
async def register_post(
|
44 |
+
request: Request,
|
45 |
+
user: UserCreate = Depends(),
|
46 |
+
db: Session = Depends(get_db)
|
47 |
+
):
|
48 |
registered_user = register(user, db)
|
49 |
return RedirectResponse("/registration_successful")
|
50 |
+
|
51 |
@app.get("/registration_successful", response_class=HTMLResponse)
|
52 |
async def registration_successful(request: Request):
|
53 |
return templates.TemplateResponse("registration_successful.html", {"request": request})
|