Minor update for sites and domains
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from __future__ import annotations
|
||||
import datetime, hashlib, logging, os, pytz, redis, secrets
|
||||
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
@@ -62,5 +61,3 @@ class Site_Domain_Base(BaseModel):
|
||||
class Config:
|
||||
underscore_attrs_are_private = True
|
||||
fields = base_fields
|
||||
|
||||
Site_Domain_Base.update_forward_refs()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from __future__ import annotations
|
||||
import datetime, hashlib, logging, os, pytz, redis, secrets
|
||||
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
@@ -57,10 +56,12 @@ class Site_Base(BaseModel):
|
||||
#html_tagline: Optional[str] = None
|
||||
|
||||
logo_filename: Optional[str]
|
||||
banner_image_filename: Optional[str]
|
||||
banner_html: Optional[str]
|
||||
banner_image_filename: Optional[str] # Old naming
|
||||
banner_html: Optional[str] # Old naming
|
||||
site_title: Optional[str]
|
||||
site_menu_html_path: Optional[str]
|
||||
site_header_html: Optional[str]
|
||||
site_header_css: Optional[str]
|
||||
site_header_h1: Optional[str]
|
||||
site_header_h2: Optional[str]
|
||||
site_body: Optional[str]
|
||||
@@ -103,5 +104,3 @@ class Site_Base(BaseModel):
|
||||
underscore_attrs_are_private = True
|
||||
allow_population_by_field_name = True
|
||||
fields = base_fields
|
||||
|
||||
Site_Base.update_forward_refs()
|
||||
|
||||
@@ -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