chg: [register sensor] uuid format

pull/24/head
Terrtia 2019-08-16 09:52:58 +02:00
parent 15bb67a086
commit e5720087de
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 1 additions and 0 deletions

View File

@ -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)