diff --git a/InvenTree/plugin/registry.py b/InvenTree/plugin/registry.py index 3a3e6f70ad..6283320aa2 100644 --- a/InvenTree/plugin/registry.py +++ b/InvenTree/plugin/registry.py @@ -32,7 +32,6 @@ from maintenance_mode.core import get_maintenance_mode, set_maintenance_mode from .integration import IntegrationPluginBase from .helpers import handle_error, log_error, get_plugins, IntegrationPluginError -from InvenTree.config import get_plugin_file logger = logging.getLogger('inventree') @@ -224,9 +223,8 @@ class PluginsRegistry: logger.info('Plugin file was already checked') return - plugin_file = pathlib.Path(get_plugin_file()) try: - output = str(subprocess.check_output(['pip', 'install', '-r', str(plugin_file.absolute())], cwd=os.path.dirname(settings.BASE_DIR)), 'utf-8') + output = str(subprocess.check_output(['pip', 'install', '-r', settings.PLUGIN_FILE], cwd=os.path.dirname(settings.BASE_DIR)), 'utf-8') except subprocess.CalledProcessError as error: # pragma: no cover logger.error(f'Ran into error while trying to install plugins!\n{str(error)}') return False diff --git a/InvenTree/plugin/serializers.py b/InvenTree/plugin/serializers.py index 14c2c11ec6..6965f398f0 100644 --- a/InvenTree/plugin/serializers.py +++ b/InvenTree/plugin/serializers.py @@ -16,7 +16,6 @@ from django.utils import timezone from rest_framework import serializers from plugin.models import PluginConfig, PluginSetting -from InvenTree.config import get_plugin_file from common.serializers import SettingsSerializer @@ -123,7 +122,7 @@ class PluginConfigInstallSerializer(serializers.Serializer): # save plugin to plugin_file if installed successfull if success: - with open(get_plugin_file(), "a") as plugin_file: + with open(settings.PLUGIN_FILE, "a") as plugin_file: plugin_file.write(f'{" ".join(install_name)} # Installed {timezone.now()} by {str(self.context["request"].user)}\n') return ret