Moving away sql_insert function creating IDs automatically. Only if asked.

This commit is contained in:
Scott Idem
2023-04-13 18:27:56 -04:00
parent 5672f9f60a
commit 43a9fe7fe5
3 changed files with 4 additions and 2 deletions

View File

@@ -230,7 +230,7 @@ def get_event_presenter_detail(
confex_presentation_id: str, # similar to 'Paper/99999'
confex_presenter_id: str, # similar to 'Person/99999'
):
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
# if result := authenticate():

View File

@@ -528,6 +528,7 @@ async def delete_obj(
def post_obj_template(
obj_type: str,
data: dict,
id_random_length: int = 8, # Added 2023-04-13; need to move away from this
return_obj: bool=True,
by_alias: bool=True,
include: Optional[list] = [],
@@ -545,7 +546,7 @@ def post_obj_template(
table_name_select = obj_type_li[obj_type]['table_name']
base_name = obj_type_li[obj_type]['base_name']
if sql_insert_result := sql_insert(table_name=table_name_insert, data=obj_data):
if sql_insert_result := sql_insert(table_name=table_name_insert, data=obj_data, id_random_length=id_random_length):
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(sql_insert_result)
obj_id = sql_insert_result

View File

@@ -36,6 +36,7 @@ async def post_event_badge_obj(
result = post_obj_template(
obj_type = obj_type,
data = obj_data_dict,
id_random_length = 0, # Added 2023-04-13; need to let SQL take care of this
return_obj = True,
by_alias = True,
exclude_unset = True,