From 87babe05f1c433b365c8da6a3333b55b78544560 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Thu, 27 May 2021 10:38:07 +0200 Subject: [PATCH] fix: [api] /lookup fix if a UUID is allocated without data --- backend/bin/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/bin/server.py b/backend/bin/server.py index e0ec030..47d74b3 100644 --- a/backend/bin/server.py +++ b/backend/bin/server.py @@ -77,6 +77,8 @@ class lookup(Resource): if not r.exists("u:{}".format(uuid)): return{'message': 'Non existing UUID'}, 404 t = r.get("u:{}".format(uuid)) + if not r.exists("{}:{}".format(t, uuid)): + return{'message': 'UUID allocated but no existing attributes'}, 404 h = r.hgetall("{}:{}".format(t, uuid)) h['_cycat_type'] = cycat_type[str(t)] return (h)