no longer gives error when making request for device data when the room doesn't exist

dev
Kyle Johnsen 2023-05-20 15:28:06 -04:00
parent 6e2fcf7096
commit f58d151003
2 changed files with 2 additions and 1 deletions

View File

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

View File

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