Fix logic error.

ap-processing-improvements
Alain St-Denis 2023-06-06 17:57:47 -04:00
rodzic 63a0e38ac9
commit f72ecf459a
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -342,7 +342,7 @@ class Object(BaseEntity, metaclass=JsonLDAnnotation):
def walk_payload(payload):
for key,val in copy.copy(payload).items():
if isinstance(val, dict):
payload.update(walk_payload(val))
walk_payload(val)
if key == 'type':
payload[key] = MODEL_NAMES.get(val.lower(), val)
return payload
@ -1439,3 +1439,6 @@ MODEL_NAMES = {}
for key,val in copy.copy(globals()).items():
if type(val) == JsonLDAnnotation and issubclass(val, Object):
MODEL_NAMES[key.lower()] = key
from pprint import pprint
pprint(MODEL_NAMES)