mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Prevent creation of new PluginConfig during data import (#6247)
* Prevent creation of new PluginConfig during data import - Fixes race condition which can occur sometimes * typo fix
This commit is contained in:
parent
716e577916
commit
7cd62527c0
@ -96,6 +96,12 @@ class MetaBase:
|
||||
|
||||
def plugin_config(self):
|
||||
"""Return the PluginConfig object associated with this plugin."""
|
||||
import InvenTree.ready
|
||||
|
||||
# Database contains no information yet - return None
|
||||
if InvenTree.ready.isImportingData():
|
||||
return None
|
||||
|
||||
try:
|
||||
import plugin.models
|
||||
|
||||
@ -104,6 +110,8 @@ class MetaBase:
|
||||
)
|
||||
except (OperationalError, ProgrammingError):
|
||||
cfg = None
|
||||
except plugin.models.PluginConfig.DoesNotExist:
|
||||
cfg = None
|
||||
|
||||
return cfg
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user