return an empty list if the extensions api is not enabled
This commit is contained in:
parent
c2b8422505
commit
bc5564259a
|
@ -17,5 +17,5 @@ SPIFFWORKFLOW_BACKEND_GIT_USERNAME = "sartography-automated-committer"
|
|||
SPIFFWORKFLOW_BACKEND_GIT_USER_EMAIL = f"{SPIFFWORKFLOW_BACKEND_GIT_USERNAME}@users.noreply.github.com"
|
||||
|
||||
SPIFFWORKFLOW_BACKEND_EXTENSIONS_API_ENABLED = (
|
||||
environ.get("SPIFFWORKFLOW_BACKEND_EXTENSIONS_API_ENABLED", default="true")
|
||||
environ.get("SPIFFWORKFLOW_BACKEND_EXTENSIONS_API_ENABLED", default="false")
|
||||
) == "true"
|
||||
|
|
|
@ -98,13 +98,15 @@ def extension_run(
|
|||
|
||||
|
||||
def extension_list() -> flask.wrappers.Response:
|
||||
_raise_unless_extensions_api_enabled()
|
||||
process_model_extensions = ProcessModelService.get_process_models_for_api(
|
||||
process_group_id=current_app.config["SPIFFWORKFLOW_BACKEND_EXTENSIONS_PROCESS_MODEL_PREFIX"],
|
||||
recursive=True,
|
||||
filter_runnable_as_extension=True,
|
||||
include_files=True,
|
||||
)
|
||||
# return an empty list if the extensions api is not enabled
|
||||
process_model_extensions = []
|
||||
if current_app.config["SPIFFWORKFLOW_BACKEND_EXTENSIONS_API_ENABLED"]:
|
||||
process_model_extensions = ProcessModelService.get_process_models_for_api(
|
||||
process_group_id=current_app.config["SPIFFWORKFLOW_BACKEND_EXTENSIONS_PROCESS_MODEL_PREFIX"],
|
||||
recursive=True,
|
||||
filter_runnable_as_extension=True,
|
||||
include_files=True,
|
||||
)
|
||||
return make_response(jsonify(process_model_extensions), 200)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue