mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 21:38:48 +00:00
- Fixes conflicts which can occur due to importing duplicate settings from a data file (cherry picked from commit 29a191e05e605d9def9022558eea4a29b8f517d9) 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
|
# Unless otherwise specified, attempt to create the setting
|
||||||
create = kwargs.pop('create', True)
|
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
|
# Perform cache lookup by default
|
||||||
do_cache = kwargs.pop('cache', True)
|
do_cache = kwargs.pop('cache', True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user