Code clean up. Working on returning proper 404 vs 400 responses if the results are empty and nothing went wrong.
This commit is contained in:
@@ -23,7 +23,7 @@ def load_cont_edu_cert_person_obj(
|
||||
enabled: str = 'enabled', # enabled, disabled, all
|
||||
inc_cont_edu_cert: bool = False,
|
||||
) -> Cont_Edu_Cert_Person_Base|dict|bool:
|
||||
# log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if cont_edu_cert_person_id := redis_lookup_id_random(record_id_random=cont_edu_cert_person_id, table_name='cont_edu_cert_person'): pass
|
||||
@@ -73,7 +73,7 @@ def get_cont_edu_cert_person_rec_list(
|
||||
limit: int = 1000,
|
||||
enabled: str = 'enabled', # enabled, disabled, all
|
||||
) -> None|list|bool:
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if cont_edu_cert_id:
|
||||
@@ -132,10 +132,13 @@ def get_cont_edu_cert_person_rec_list(
|
||||
ORDER BY `tbl`.created_on DESC, `tbl`.updated_on DESC
|
||||
{sql_limit};
|
||||
"""
|
||||
log.debug(sql)
|
||||
|
||||
if cont_edu_cert_person_rec_li_result := sql_select(data=data, sql=sql):
|
||||
log.info('Got a list result')
|
||||
cont_edu_cert_person_rec_li = cont_edu_cert_person_rec_li_result
|
||||
else: # None or False
|
||||
log.info('No results or something went wrong')
|
||||
cont_edu_cert_person_rec_li = cont_edu_cert_person_rec_li_result # []
|
||||
|
||||
log.debug(cont_edu_cert_person_rec_li_result)
|
||||
|
||||
Reference in New Issue
Block a user