This commit is contained in:
benarc
2021-11-12 04:14:55 +00:00
parent 860709f48c
commit 267dea4f75
61 changed files with 23219 additions and 13297 deletions
+9 -6
View File
@@ -14,9 +14,12 @@ from .crud import get_domain
templates = Jinja2Templates(directory="templates")
@subdomains_ext.get("/", response_class=HTMLResponse)
async def index(request: Request, user: User = Depends(check_user_exists)):
return subdomains_renderer().TemplateResponse("subdomains/index.html", {"request": request, "user": user.dict()})
return subdomains_renderer().TemplateResponse(
"subdomains/index.html", {"request": request, "user": user.dict()}
)
@subdomains_ext.get("/{domain_id}")
@@ -24,20 +27,20 @@ async def display(request: Request, domain_id):
domain = await get_domain(domain_id)
if not domain:
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND,
detail="Domain does not exist."
status_code=HTTPStatus.NOT_FOUND, detail="Domain does not exist."
)
allowed_records = (
domain.allowed_record_types.replace('"', "").replace(" ", "").split(",")
)
return subdomains_renderer().TemplateResponse(
"subdomains/display.html",{
"subdomains/display.html",
{
"request": request,
"domain_id": domain.id,
"domain_domain": domain.domain,
"domain_desc": domain.description,
"domain_cost": domain.cost,
"domain_allowed_record_types": allowed_records,
}
},
)