Minor update for sites and domains
This commit is contained in:
@@ -85,7 +85,7 @@ async def lookup_site_domain_obj(
|
||||
exclude_none: bool = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
data = {}
|
||||
@@ -136,17 +136,16 @@ async def lookup_site_domain_obj(
|
||||
log.info('Got a site domain result')
|
||||
try:
|
||||
site_obj = Site_Base(**site_domain_obj_result).dict(by_alias=by_alias, exclude_unset=exclude_unset, exclude_none=exclude_none)
|
||||
log.debug(site_obj)
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
log.debug(site_obj)
|
||||
try:
|
||||
site_domain_obj = Site_Domain_Base(**site_domain_obj_result).dict(by_alias=by_alias, exclude_unset=exclude_unset, exclude_none=exclude_none)
|
||||
log.debug(site_domain_obj)
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
log.debug(site_domain_obj)
|
||||
|
||||
site_domain_obj['site'] = site_obj
|
||||
log.debug(site_domain_obj)
|
||||
|
||||
return mk_resp(data=site_domain_obj, response=response)
|
||||
elif isinstance(site_domain_obj_result, list):
|
||||
@@ -215,14 +214,14 @@ async def get_site_domain_obj(
|
||||
if site_domain_obj_result := sql_select(data=data, sql=sql):
|
||||
try:
|
||||
site_obj = Site_Base(**site_domain_obj_result).dict(by_alias=by_alias, exclude_unset=exclude_unset, exclude_none=exclude_none)
|
||||
log.debug(site_obj)
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
log.debug(site_obj)
|
||||
try:
|
||||
site_domain_obj = Site_Domain_Base(**site_domain_obj_result).dict(by_alias=by_alias, exclude_unset=exclude_unset, exclude_none=exclude_none)
|
||||
log.debug(site_domain_obj)
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
log.debug(site_domain_obj)
|
||||
|
||||
site_domain_obj['site'] = site_obj
|
||||
log.debug(site_domain_obj)
|
||||
|
||||
Reference in New Issue
Block a user