in django_airavata/apps/api/views.py [0:0]
def _update_input_metadata(self, app_interface):
for app_input in app_interface.applicationInputs:
if app_input.metaData:
metadata = json.loads(app_input.metaData)
# Automatically add {showOptions: {isRequired: true/false}} to
# toggle isRequired on hidden/shown inputs
if ("editor" in metadata and
"dependencies" in metadata["editor"] and
"show" in metadata["editor"]["dependencies"]):
if "showOptions" not in metadata["editor"]["dependencies"]:
metadata["editor"]["dependencies"]["showOptions"] = {}
o = metadata["editor"]["dependencies"]["showOptions"]
o["isRequired"] = app_input.isRequired
app_input.metaData = json.dumps(metadata)