Skip to content
Snippets Groups Projects
Commit b8ba5670 authored by Sebastian Lobinger's avatar Sebastian Lobinger
Browse files

update sams_hub.py addApp + menu use _appList to pass test_main_app

parent c0567961
No related branches found
No related tags found
1 merge request!1Resolve "Eine App sollte in SAMSHub als main bestimmt werden können und für URLs kein prefiy erhalten"
......@@ -25,6 +25,7 @@ class SAMSHub:
raise TypeError(
'Parameter config musst contain a value for "default_language"')
self._apps = {}
self._appList = []
self._flaskApp = Flask(name)
self._flaskApp.context_processor(self._context_processor)
self._flaskApp.secret_key = 'my awesome SAMSHub secret_key'
......@@ -33,6 +34,7 @@ class SAMSHub:
if not isinstance(app, SAMSApp):
raise TypeError('Argument app has to be a SAMSApp.')
self._apps[app.name] = app
self._appList.append(app)
if app.name is self._config.get('main_app'):
self._flaskApp.register_blueprint(app.blueprint)
else:
......@@ -75,7 +77,7 @@ class SAMSHub:
def menu(self, langCode):
menu = []
for app in self._apps.values():
for app in self._appList:
if self._config.get('main_app') is app.name:
menu.extend(app.menu(langCode = langCode))
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment