Work on exhibit and tracking
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import datetime
|
||||
import datetime, time
|
||||
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
@@ -34,9 +34,11 @@ async def post_event_exhibit_tracking_obj(
|
||||
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
# time.sleep(1)
|
||||
|
||||
# ### SECTION ### Secondary data validation
|
||||
if event_exhibit_id := redis_lookup_id_random(record_id_random=event_exhibit_id, table_name='event_exhibit'): pass
|
||||
# elif event_exhibit_id is None: pass
|
||||
@@ -61,7 +63,13 @@ async def post_event_exhibit_tracking_obj(
|
||||
event_person_id = event_person_id,
|
||||
): pass
|
||||
elif event_exhibit_tracking_id is None:
|
||||
return mk_resp(data=None, status_code=200, response=commons.response, status_message='Not created. Likely duplicate entry. Returning None.') # Success
|
||||
# NOTE: I think it makes sense to try and look up the record using the Exhibitor and Person ID. This is for API call convenience.
|
||||
if event_exhibit_tracking_rec_li := get_event_exhibit_tracking_rec_list(event_exhibit_id=event_exhibit_id,event_person_id=event_person_id):
|
||||
event_exhibit_tracking_rec = event_exhibit_tracking_rec_li[0]
|
||||
event_exhibit_tracking_id = event_exhibit_tracking_rec.get('event_exhibit_tracking_id')
|
||||
else:
|
||||
log.warning('Should this be possible if there was an existing record? Assuming there is an existing record because the SQL function result was None.')
|
||||
return mk_resp(data=None, status_code=200, response=commons.response, status_message='Not created. Likely duplicate entry. Returning None.') # Success
|
||||
else:
|
||||
log.warning('Likely bad request')
|
||||
return mk_resp(data=False, status_code=400, response=commons.response, status_message='Not created. Something failed while processing the data. Check the field names and data types.') # Bad Request
|
||||
|
||||
Reference in New Issue
Block a user