no longer gives error when making request for device data when the room doesn't exist
parent
6e2fcf7096
commit
f58d151003
|
|
@ -72,7 +72,7 @@ CREATE TABLE `DataBlock` (
|
||||||
`id` TEXT NOT NULL,
|
`id` TEXT NOT NULL,
|
||||||
-- id of the owner of this file. Ownership is not transferable because ids may collide,
|
-- id of the owner of this file. Ownership is not transferable because ids may collide,
|
||||||
-- but the owner could be null for global scope
|
-- but the owner could be null for global scope
|
||||||
`owner_id` TEXT NOT NULL DEFAULT 'none',
|
`owner_id` TEXT DEFAULT 'none',
|
||||||
`visibility` TEXT CHECK( `visibility` IN ('public','private','unlisted') ) NOT NULL DEFAULT 'public',
|
`visibility` TEXT CHECK( `visibility` IN ('public','private','unlisted') ) NOT NULL DEFAULT 'public',
|
||||||
-- This is an indexable field to filter out different types of datablocks
|
-- This is an indexable field to filter out different types of datablocks
|
||||||
`category` TEXT,
|
`category` TEXT,
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,7 @@ def get_device_data(request: Request, response: Response, hw_id: str):
|
||||||
room_data = get_data(response, key=room_key, user_id=user['id'])
|
room_data = get_data(response, key=room_key, user_id=user['id'])
|
||||||
|
|
||||||
if "error" in room_data:
|
if "error" in room_data:
|
||||||
|
response.status_code = None # this really isn't an error, so we reset the status code
|
||||||
set_data(request, data={}, key=room_key,
|
set_data(request, data={}, key=room_key,
|
||||||
modified_by=None, category="room")
|
modified_by=None, category="room")
|
||||||
room_data = get_data(response, key=room_key, user_id=user['id'])
|
room_data = get_data(response, key=room_key, user_id=user['id'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue