2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue2519

This commit is contained in:
Matthias
2022-01-12 00:12:32 +01:00
22 changed files with 582 additions and 30 deletions

View File

@ -1,21 +1,31 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.apps import AppConfig
from django.conf import settings
from maintenance_mode.core import set_maintenance_mode
from plugin import registry
logger = logging.getLogger('inventree')
class PluginAppConfig(AppConfig):
name = 'plugin'
def ready(self):
if not registry.is_loading:
# this is the first startup
registry.collect_plugins()
registry.load_plugins()
if settings.PLUGINS_ENABLED:
logger.info('Loading InvenTree plugins')
# drop out of maintenance
# makes sure we did not have an error in reloading and maintenance is still active
set_maintenance_mode(False)
if not registry.is_loading:
# this is the first startup
registry.collect_plugins()
registry.load_plugins()
# drop out of maintenance
# makes sure we did not have an error in reloading and maintenance is still active
set_maintenance_mode(False)