fixed core issue of missing applications in new project

This commit is contained in:
iLLiCiTiT 2021-06-04 00:38:33 +02:00
parent 2dc55ccfdd
commit 3d66b080cf
2 changed files with 8 additions and 8 deletions

View file

@ -91,11 +91,6 @@ def create_project(
# and Anatomy
try:
project_settings_entity = ProjectSettings(project_name)
# Trigger remove project overrides
# - will set all anatomy values to defaults
# - project's anatomy will still be overriden
project_anatomy = project_settings_entity["project_anatomy"]
project_anatomy.remove_from_project_override()
project_settings_entity.save()
except SaveWarningExc as exc:
print(str(exc))

View file

@ -590,16 +590,21 @@ class MongoSettingsHandler(SettingsHandler):
attributes[key] = value
project_doc_config = project_doc.get("config") or {}
app_names = set()
if "apps" in project_doc_config:
for app_item in project_doc_config.pop("apps"):
if not project_doc_config or "apps" not in project_doc_config:
set_applications = False
else:
set_applications = True
for app_item in project_doc_config["apps"]:
if not app_item:
continue
app_name = app_item.get("name")
if app_name:
app_names.add(app_name)
attributes["applications"] = list(app_names)
if set_applications:
attributes["applications"] = list(app_names)
output = {"attributes": attributes}
for key in self.anatomy_keys: