just use the setting

This commit is contained in:
Matthias 2022-03-15 01:25:52 +01:00
parent d9d2f39072
commit e398d64885
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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