black
This commit is contained in:
@@ -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,
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user