2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 13:35:40 +00:00

Removes custom plugins directory

- rely on plugins.txt instead
This commit is contained in:
Oliver
2022-01-06 13:31:04 +11:00
parent 75d5f9d6e6
commit 836b6275b6
3 changed files with 17 additions and 31 deletions

View File

@ -934,23 +934,6 @@ if DEBUG or TESTING:
# load samples in debug mode
PLUGIN_DIRS.append('plugin.samples')
# Check if an external plugin directory has been specified as an environment variable
# Note: This should be specified as INVENTREE_PLUGIN_DIR
plugin_dir = os.getenv('INVENTREE_PLUGIN_DIR')
if plugin_dir:
if not os.path.exists(plugin_dir):
logger.info(f"Plugin directory '{plugin_dir}' does not exist")
try:
os.makedirs(plugin_dir, exist_ok=True)
logger.info(f"Created plugin directory '{plugin_dir}'")
except:
logger.warning(f"Could not create plugins directory '{plugin_dir}'")
if os.path.exists(plugin_dir):
PLUGIN_DIRS.append(plugin_dir)
# Plugin test settings
PLUGIN_TESTING = get_setting('PLUGIN_TESTING', TESTING) # are plugins beeing tested?
PLUGIN_TESTING_SETUP = get_setting('PLUGIN_TESTING_SETUP', False) # load plugins from setup hooks in testing?