mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 21:16:46 +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):
|
def plugin_config(self):
|
||||||
"""Return the PluginConfig object associated with this plugin."""
|
"""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:
|
try:
|
||||||
import plugin.models
|
import plugin.models
|
||||||
|
|
||||||
@ -104,6 +110,8 @@ class MetaBase:
|
|||||||
)
|
)
|
||||||
except (OperationalError, ProgrammingError):
|
except (OperationalError, ProgrammingError):
|
||||||
cfg = None
|
cfg = None
|
||||||
|
except plugin.models.PluginConfig.DoesNotExist:
|
||||||
|
cfg = None
|
||||||
|
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user