mirror of https://github.com/D4-project/d4-core
chg: [register sensor] uuid format
parent
15bb67a086
commit
e5720087de
|
@ -28,6 +28,7 @@ def register_sensor(req_dict):
|
||||||
# verify uuid
|
# verify uuid
|
||||||
if not is_valid_uuid_v4(sensor_uuid):
|
if not is_valid_uuid_v4(sensor_uuid):
|
||||||
return ({"status": "error", "reason": "Invalid uuid"}, 400)
|
return ({"status": "error", "reason": "Invalid uuid"}, 400)
|
||||||
|
sensor_uuid = sensor_uuid.replace('-', '')
|
||||||
# sensor already exist
|
# sensor already exist
|
||||||
if r_serv_db.exists('metadata_uuid:{}'.format(sensor_uuid)):
|
if r_serv_db.exists('metadata_uuid:{}'.format(sensor_uuid)):
|
||||||
return ({"status": "error", "reason": "Sensor already registred"}, 409)
|
return ({"status": "error", "reason": "Sensor already registred"}, 409)
|
||||||
|
|
Loading…
Reference in New Issue