mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Docker plugin config (#3977)
* Make setting default values callable * Update default value for 'PLUGIN_ON_STARTUP' setting - Defaults to True if running in docker
This commit is contained in:
parent
b43729dca3
commit
fbf4b756ab
@ -258,7 +258,12 @@ class BaseInvenTreeSetting(models.Model):
|
||||
"""
|
||||
setting = cls.get_setting_definition(key, **kwargs)
|
||||
|
||||
return setting.get('default', '')
|
||||
default = setting.get('default', '')
|
||||
|
||||
if callable(default):
|
||||
return default()
|
||||
else:
|
||||
return default
|
||||
|
||||
@classmethod
|
||||
def get_setting_choices(cls, key, **kwargs):
|
||||
@ -1345,7 +1350,7 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
||||
'PLUGIN_ON_STARTUP': {
|
||||
'name': _('Check plugins on startup'),
|
||||
'description': _('Check that all plugins are installed on startup - enable in container environments'),
|
||||
'default': False,
|
||||
'default': settings.DOCKER,
|
||||
'validator': bool,
|
||||
'requires_restart': True,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user