Working on membership, person, user, and order and general clean up.
This commit is contained in:
@@ -291,6 +291,21 @@ def get_order_rec_list(
|
||||
# data['for_obj_type'] = for_obj_type
|
||||
sql_obj_type_id = f'`tbl`.{for_obj_type}_id = :{for_obj_type}_id'
|
||||
|
||||
allowed_status_li = ['started', 'in progress', 'complete', 'all']
|
||||
sql_status = ''
|
||||
if status in allowed_status_li:
|
||||
if status == 'status':
|
||||
data['status'] = True
|
||||
sql_status = f'AND `tbl`.status = :status'
|
||||
elif status == 'disabled':
|
||||
data['status'] = False
|
||||
sql_status = f'AND `tbl`.status = :status'
|
||||
elif status == 'all':
|
||||
sql_status = ''
|
||||
else:
|
||||
log.warning('The status value passed is not allowed. Returning None')
|
||||
return None
|
||||
|
||||
# if enabled in ['enabled', 'disabled', 'all']:
|
||||
# if enabled == 'enabled':
|
||||
# data['enable'] = True
|
||||
@@ -313,6 +328,7 @@ def get_order_rec_list(
|
||||
FROM `order` AS `tbl`
|
||||
WHERE
|
||||
{sql_obj_type_id}
|
||||
{sql_status}
|
||||
{sql_enabled}
|
||||
ORDER BY `tbl`.created_on DESC, `tbl`.updated_on DESC
|
||||
{sql_limit};
|
||||
|
||||
Reference in New Issue
Block a user