diff --git a/api/src/reportcreator_api/conf/plugins.py b/api/src/reportcreator_api/conf/plugins.py index b7093112..1721dee7 100644 --- a/api/src/reportcreator_api/conf/plugins.py +++ b/api/src/reportcreator_api/conf/plugins.py @@ -225,13 +225,13 @@ def load_plugins(plugin_dirs: list[Path], enabled_plugins: list[str]): continue init_file = module_dir / '__init__.py' - app_file = module_dir / 'app.py' - if not init_file.is_file() or not app_file.is_file(): + apps_file = module_dir / 'apps.py' + if not init_file.is_file() or not apps_file.is_file(): continue module_name = f"sysreptor_plugins.{module_dir.name}" try: - plugin_app_module = import_module(module_name + '.app') + plugin_app_module = import_module(module_name + '.apps') except ImportError: continue plugin_config_class = next(filter(lambda c: issubclass(c, PluginConfig) and c != PluginConfig, map(lambda c: getattr(plugin_app_module, c), dir(plugin_app_module))), None) diff --git a/api/src/reportcreator_api/tests/test_plugins.py b/api/src/reportcreator_api/tests/test_plugins.py index f5b40a6f..02d6bcd9 100644 --- a/api/src/reportcreator_api/tests/test_plugins.py +++ b/api/src/reportcreator_api/tests/test_plugins.py @@ -25,7 +25,7 @@ def enable_demoplugin(): # Import config to check if plugin exists try: - from sysreptor_plugins.demoplugin.app import DemoPluginConfig # type: ignore + from sysreptor_plugins.demoplugin.apps import DemoPluginConfig # type: ignore except ImportError: pytest.skip('DemoPlugin not found') @@ -45,7 +45,7 @@ def enable_demoplugin(): def disable_demoplugin(): with override_settings( ENABLED_PLUGINS=[plugin for plugin in settings.ENABLED_PLUGINS if plugin not in ['demoplugin', DEMOPLUGIN_ID]], - INSTALLED_APPS=[app for app in settings.INSTALLED_APPS if app != 'sysreptor_plugins.demoplugin.app.DemoPluginConfig'], + INSTALLED_APPS=[app for app in settings.INSTALLED_APPS if app != 'sysreptor_plugins.demoplugin.apps.DemoPluginConfig'], ): yield @@ -89,7 +89,7 @@ def test_plugin_loading(self): assert omit_keys(demoplugin_config, ['frontend_entry']) == {'id': DEMOPLUGIN_ID, 'name': 'demoplugin', 'frontend_settings': {}} def test_load_professional_only(self): - from sysreptor_plugins.demoplugin.app import DemoPluginConfig # type: ignore + from sysreptor_plugins.demoplugin.apps import DemoPluginConfig # type: ignore try: DemoPluginConfig.professional_only = True diff --git a/plugins/checkthehash/app.py b/plugins/checkthehash/apps.py similarity index 100% rename from plugins/checkthehash/app.py rename to plugins/checkthehash/apps.py diff --git a/plugins/customizetheme/app.py b/plugins/customizetheme/apps.py similarity index 100% rename from plugins/customizetheme/app.py rename to plugins/customizetheme/apps.py diff --git a/plugins/cyberchef/app.py b/plugins/cyberchef/apps.py similarity index 100% rename from plugins/cyberchef/app.py rename to plugins/cyberchef/apps.py diff --git a/plugins/demoplugin/app.py b/plugins/demoplugin/apps.py similarity index 100% rename from plugins/demoplugin/app.py rename to plugins/demoplugin/apps.py diff --git a/plugins/demoplugin/tests/test_plugin_api.py b/plugins/demoplugin/tests/test_plugin_api.py index 5bf6658b..4290babe 100644 --- a/plugins/demoplugin/tests/test_plugin_api.py +++ b/plugins/demoplugin/tests/test_plugin_api.py @@ -19,7 +19,7 @@ websocket_client, ) -from ..app import DemoPluginConfig +from ..apps import DemoPluginConfig from ..models import DemoPluginModel PLUGIN_ID = DemoPluginConfig.plugin_id diff --git a/plugins/graphqlvoyager/app.py b/plugins/graphqlvoyager/apps.py similarity index 100% rename from plugins/graphqlvoyager/app.py rename to plugins/graphqlvoyager/apps.py diff --git a/plugins/projectnumber/app.py b/plugins/projectnumber/apps.py similarity index 100% rename from plugins/projectnumber/app.py rename to plugins/projectnumber/apps.py diff --git a/plugins/projectnumber/signals.py b/plugins/projectnumber/signals.py index 3c0cb047..ba4c73d3 100644 --- a/plugins/projectnumber/signals.py +++ b/plugins/projectnumber/signals.py @@ -13,7 +13,7 @@ ReportSection, ) -from .app import ProjectNumberPluginConfig +from .apps import ProjectNumberPluginConfig from .models import ProjectNumber log = logging.getLogger(__name__) diff --git a/plugins/projectnumber/tests/test_plugin_api.py b/plugins/projectnumber/tests/test_plugin_api.py index e5c36ca5..b031bbc6 100644 --- a/plugins/projectnumber/tests/test_plugin_api.py +++ b/plugins/projectnumber/tests/test_plugin_api.py @@ -19,7 +19,7 @@ create_user, ) -from ..app import ProjectNumberPluginConfig +from ..apps import ProjectNumberPluginConfig from ..management.commands import resetprojectnumber from ..models import ProjectNumber diff --git a/plugins/renderfindings/app.py b/plugins/renderfindings/apps.py similarity index 100% rename from plugins/renderfindings/app.py rename to plugins/renderfindings/apps.py diff --git a/plugins/renderfindings/tests/test_renderfindings.py b/plugins/renderfindings/tests/test_renderfindings.py index 43572a29..7c1d1adf 100644 --- a/plugins/renderfindings/tests/test_renderfindings.py +++ b/plugins/renderfindings/tests/test_renderfindings.py @@ -15,7 +15,7 @@ create_user, ) -from ..app import RenderFindingsPluginConfig +from ..apps import RenderFindingsPluginConfig URL_NAMESPACE = RenderFindingsPluginConfig.label diff --git a/plugins/webhooks/app.py b/plugins/webhooks/apps.py similarity index 100% rename from plugins/webhooks/app.py rename to plugins/webhooks/apps.py diff --git a/plugins/webhooks/tests/test_webhooks.py b/plugins/webhooks/tests/test_webhooks.py index 872e0ae9..15903a2e 100644 --- a/plugins/webhooks/tests/test_webhooks.py +++ b/plugins/webhooks/tests/test_webhooks.py @@ -8,7 +8,7 @@ from reportcreator_api.tests.mock import create_finding, create_project, create_user from reportcreator_api.utils import utils -from ..app import WebhooksPluginConfig +from ..apps import WebhooksPluginConfig from ..models import WebhookEventType diff --git a/plugins/webhooks/utils.py b/plugins/webhooks/utils.py index 8e4a3302..0778b633 100644 --- a/plugins/webhooks/utils.py +++ b/plugins/webhooks/utils.py @@ -6,7 +6,7 @@ from django.apps import apps from reportcreator_api.utils.utils import run_in_background -from .app import WebhooksPluginConfig +from .apps import WebhooksPluginConfig from .models import WebhookEventType