|
@@ -14,9 +14,12 @@ router = APIRouter()
|
|
|
@router.post('/user/{user_id}', response_model=BluetoothUserResponse)
|
|
|
async def create_bluetooth_info(user_id: str, bluetooth_info: List[BluetoothCreate]):
|
|
|
valid_data = []
|
|
|
- for item in bluetooth_info:
|
|
|
- if len(item.advertisData) == 31:
|
|
|
- valid_data.append(item)
|
|
|
+ try:
|
|
|
+ for item in bluetooth_info:
|
|
|
+ if len(item.advertisData) == 31:
|
|
|
+ valid_data.append(item)
|
|
|
+ except TypeError:
|
|
|
+ pass
|
|
|
logger.debug(valid_data)
|
|
|
info_list = [item.dict() for item in bluetooth_info]
|
|
|
logger.info(f'{user_id}: {info_list}')
|