From 2ec45dd2c816b3399002ce5adaa0c28d0ac0162c Mon Sep 17 00:00:00 2001 From: Johan Castiblanco Date: Mon, 9 Dec 2024 22:15:04 -0500 Subject: [PATCH] fix: templates loading reset This fix the order ready method of eox_nelp works. Mainly this avoid that if eox_nelp is intalled before eox_theming. eox_theming should not reset look_ups in it ready method. https://github.com/eduNEXT/eox-theming/blob/v8.1.0/eox_theming/apps.py#L58 So with this change eox_nelp exteding template in the ready method would work. https://github.com/eduNEXT/eox-nelp/blob/8c8306e59e94bc0209c49d044dc5d5c12874be98/eox_nelp/init_pipeline.py#L60 --- eox_nelp/settings/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eox_nelp/settings/common.py b/eox_nelp/settings/common.py index 3c8c2be6..77b666e0 100644 --- a/eox_nelp/settings/common.py +++ b/eox_nelp/settings/common.py @@ -26,6 +26,7 @@ JSON_API_REST_FRAMEWORK = 'rest_framework_json_api' EOX_AUDIT_MODEL_APP = 'eox_audit_model.apps.EoxAuditModelConfig' +EOX_NELP_MODEL_APP = 'eox_nelp.apps.EoxNelpConfig' def plugin_settings(settings): @@ -67,7 +68,6 @@ def plugin_settings(settings): settings.INSTALLED_APPS.append(JSON_API_REST_FRAMEWORK) if find_spec('eox_audit_model') and EOX_AUDIT_MODEL_APP not in settings.INSTALLED_APPS: settings.INSTALLED_APPS.append(EOX_AUDIT_MODEL_APP) - try: payments_notifications_context = ( 'eox_nelp.payment_notifications.context_processor.payments_notifications_context' @@ -82,3 +82,7 @@ def plugin_settings(settings): except AttributeError: # We must find a way to register this error pass + # Ensure EOX_NELP is the last plugin installed app for ready run. + if EOX_NELP_MODEL_APP in settings.INSTALLED_APPS and settings.INSTALLED_APPS[-1] != EOX_NELP_MODEL_APP: + settings.INSTALLED_APPS.remove(EOX_NELP_MODEL_APP) + settings.INSTALLED_APPS.append(EOX_NELP_MODEL_APP)