mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
just use the setting
This commit is contained in:
parent
d9d2f39072
commit
e398d64885
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user