include time restriction
All checks were successful
release-tag / release-image (push) Successful in 42s
All checks were successful
release-tag / release-image (push) Successful in 42s
This commit is contained in:
@@ -5,27 +5,28 @@ from app.models import RegistrationCreate
|
||||
from app import crud
|
||||
from app.api.deps import SessionDep
|
||||
|
||||
from app.core.utils import is_registration_open
|
||||
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
router = APIRouter(prefix="/registration")
|
||||
|
||||
|
||||
@router.post(
|
||||
"/register",
|
||||
"/register_form",
|
||||
)
|
||||
def register(*, session: SessionDep, registration_create: Annotated[RegistrationCreate, Form()]):
|
||||
print(registration_create)
|
||||
def register(
|
||||
*, session: SessionDep, registration_create: Annotated[RegistrationCreate, Form()]
|
||||
):
|
||||
"""
|
||||
Register
|
||||
"""
|
||||
|
||||
registration = crud.create_registration(session=session, registration_create=registration_create)
|
||||
#if settings.emails_enabled and user_in.email:
|
||||
# email_data = generate_new_account_email(
|
||||
# email_to=user_in.email, username=user_in.email, password=user_in.password
|
||||
# )
|
||||
# send_email(
|
||||
# email_to=user_in.email,
|
||||
# subject=email_data.subject,
|
||||
# html_content=email_data.html_content,
|
||||
# )
|
||||
|
||||
return registration
|
||||
if is_registration_open():
|
||||
crud.create_registration(
|
||||
session=session, registration_create=registration_create
|
||||
)
|
||||
|
||||
return RedirectResponse("/success.html", status_code=303)
|
||||
else:
|
||||
return RedirectResponse("/", status_code=303)
|
||||
|
||||
Reference in New Issue
Block a user