You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2019/08/26 21:16:35 UTC
[airavata-django-portal] 01/02: Delay enhancing app configs until
needed
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit 6c251d71a8fd26ea68fe2b18aa911e53ed2b9157
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Aug 26 17:16:04 2019 -0400
Delay enhancing app configs until needed
---
django_airavata/context_processors.py | 7 +++++--
django_airavata/settings.py | 1 -
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/django_airavata/context_processors.py b/django_airavata/context_processors.py
index 1398e28..889272e 100644
--- a/django_airavata/context_processors.py
+++ b/django_airavata/context_processors.py
@@ -9,7 +9,10 @@ from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.urls import reverse
-from django_airavata.app_config import AiravataAppConfig
+from django_airavata.app_config import (
+ AiravataAppConfig,
+ enhance_custom_app_config
+)
from django_airavata.apps.api.models import User_Notifications
logger = logging.getLogger(__name__)
@@ -98,7 +101,7 @@ def airavata_app_registry(request):
def custom_app_registry(request):
"""Put custom Django apps into the context."""
custom_apps = settings.CUSTOM_DJANGO_APPS.copy()
- custom_apps = [app for app in custom_apps
+ custom_apps = [enhance_custom_app_config(app) for app in custom_apps
if (getattr(app, 'enabled', None) is None or
app.enabled(request)
)]
diff --git a/django_airavata/settings.py b/django_airavata/settings.py
index bb5ab3f..babba5a 100644
--- a/django_airavata/settings.py
+++ b/django_airavata/settings.py
@@ -100,7 +100,6 @@ CUSTOM_DJANGO_APPS = []
#
for entry_point in iter_entry_points(group='airavata.djangoapp'):
custom_app_class = entry_point.load()
- custom_app_class = enhance_custom_app_config(custom_app_class)
custom_app_instance = custom_app_class(entry_point.name, import_module(entry_point.module_name))
CUSTOM_DJANGO_APPS.append(custom_app_instance)
# Create path to AppConfig class (otherwise the ready() method doesn't get