mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Prevent write of SERVER_RESTART_REQUIRED setting when importing dataset (#3249)
This commit is contained in:
parent
daf019c13a
commit
5b54979202
@ -4,6 +4,8 @@ import logging
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
from InvenTree.ready import isImportingData
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
@ -26,6 +28,8 @@ class CommonConfig(AppConfig):
|
||||
|
||||
if common.models.InvenTreeSetting.get_setting('SERVER_RESTART_REQUIRED', backup_value=False, create=False, cache=False):
|
||||
logger.info("Clearing SERVER_RESTART_REQUIRED flag")
|
||||
|
||||
if not isImportingData():
|
||||
common.models.InvenTreeSetting.set_setting('SERVER_RESTART_REQUIRED', False, None)
|
||||
except Exception:
|
||||
pass
|
||||
|
@ -37,6 +37,7 @@ from rest_framework.exceptions import PermissionDenied
|
||||
|
||||
import InvenTree.fields
|
||||
import InvenTree.helpers
|
||||
import InvenTree.ready
|
||||
import InvenTree.validators
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
@ -748,7 +749,7 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
||||
"""
|
||||
super().save()
|
||||
|
||||
if self.requires_restart():
|
||||
if self.requires_restart() and not InvenTree.ready.isImportingData():
|
||||
InvenTreeSetting.set_setting('SERVER_RESTART_REQUIRED', True, None)
|
||||
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user