Fixed rule expansion for LabThings 0.6.2
This commit is contained in:
parent
49d677a56b
commit
b8c0ca257c
1 changed files with 5 additions and 1 deletions
|
|
@ -13,6 +13,10 @@ def build_gui_from_dict(gui_description, extension_object):
|
||||||
# Make a working copy of GUI description
|
# Make a working copy of GUI description
|
||||||
api_gui = copy.deepcopy(gui_description)
|
api_gui = copy.deepcopy(gui_description)
|
||||||
|
|
||||||
|
print("")
|
||||||
|
print(extension_object)
|
||||||
|
print(extension_object._rules)
|
||||||
|
|
||||||
# Expand shorthand routes into full relative URLs
|
# Expand shorthand routes into full relative URLs
|
||||||
if "forms" in gui_description and isinstance(api_gui["forms"], list):
|
if "forms" in gui_description and isinstance(api_gui["forms"], list):
|
||||||
for form in api_gui["forms"]:
|
for form in api_gui["forms"]:
|
||||||
|
|
@ -21,7 +25,7 @@ def build_gui_from_dict(gui_description, extension_object):
|
||||||
form["route"] = clean_rule(form["route"])
|
form["route"] = clean_rule(form["route"])
|
||||||
# Match rule in extension object
|
# Match rule in extension object
|
||||||
if "route" in form and form["route"] in extension_object._rules.keys():
|
if "route" in form and form["route"] in extension_object._rules.keys():
|
||||||
form["route"] = extension_object._rules[form["route"]]["rule"]
|
form["route"] = extension_object._rules[form["route"]]["urls"][0]
|
||||||
else:
|
else:
|
||||||
logging.warn(
|
logging.warn(
|
||||||
"No valid expandable route found for {}".format(form["route"])
|
"No valid expandable route found for {}".format(form["route"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue