mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
- Fixes conflicts which can occur due to importing duplicate settings from a data file
(cherry picked from commit 29a191e05e
)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
a7c0882c02
commit
57e9497da1
@ -409,6 +409,14 @@ class BaseInvenTreeSetting(models.Model):
|
||||
# Unless otherwise specified, attempt to create the setting
|
||||
create = kwargs.pop('create', True)
|
||||
|
||||
# Prevent saving to the database during data import
|
||||
if InvenTree.ready.isImportingData():
|
||||
create = False
|
||||
|
||||
# Prevent saving to the database during migrations
|
||||
if InvenTree.ready.isRunningMigrations():
|
||||
create = False
|
||||
|
||||
# Perform cache lookup by default
|
||||
do_cache = kwargs.pop('cache', True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user