Skip to content

Commit 41da60e

Browse files
committed
safe get from dict in get_apijson_tables
1 parent add1e5b commit 41da60e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uliweb_apijson/apijson/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ def get_apijson_tables(role="UNKNOWN"):
1010
return {}
1111
for n in apijson_tables:
1212
c = apijson_tables[n]
13-
editable = c["editable"]
13+
editable = c.get("editable",False)
1414
_model_name = c.get("@model_name") or n
1515
if editable=="auto":
1616
editable = False
17-
POST = settings.APIJSON_MODELS[_model_name]["POST"]
17+
POST = settings.APIJSON_MODELS.get(_model_name,{}).get("POST")
1818
if POST:
1919
roles = POST["roles"]
2020
if roles:

0 commit comments

Comments
 (0)