black formatting

This commit is contained in:
Kristjan 2021-01-03 00:31:02 +01:00
parent 33b48341f1
commit f6010bc139
2 changed files with 4 additions and 3 deletions

View File

@ -71,10 +71,11 @@ async def get_subdomain(subdomain_id: str) -> Optional[Subdomains]:
print(row)
return Subdomains(**row) if row else None
async def get_subdomainBySubdomain(subdomain: str) -> Optional[Subdomains]:
row = await db.fetchone(
"SELECT s.*, d.domain as domain_name FROM subdomain s INNER JOIN domain d ON (s.domain = d.id) WHERE s.subdomain = ?",
(subdomain, ),
(subdomain,),
)
print(row)
return Subdomains(**row) if row else None

View File

@ -19,7 +19,7 @@ from .crud import (
get_domain,
get_domains,
delete_domain,
get_subdomainBySubdomain
get_subdomainBySubdomain,
)
@ -123,7 +123,7 @@ async def api_subdomain_make_subdomain(domain_id):
HTTPStatus.BAD_REQUEST,
)
if ( await get_subdomainBySubdomain(g.data["subdomain"]) is not None):
if await get_subdomainBySubdomain(g.data["subdomain"]) is not None:
return (
jsonify({"message": g.data["subdomain"] + "." + domain.domain + " domain already taken"}),
HTTPStatus.BAD_REQUEST,