mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-10 10:57:52 +00:00
Handle ValidationError when creating a new setting (#4868)
- Duplicate keys can occur in some race conditions - Catch and pass ValidationError
This commit is contained in:
1 parent
63da2ae9f7
commit
5992dcdfda
1 file changed
+3
@@ -453,6 +453,9 @@ class BaseInvenTreeSetting(models.Model):
|
||||
except (IntegrityError, OperationalError):
|
||||
# It might be the case that the database isn't created yet
|
||||
pass
|
||||
except ValidationError:
|
||||
# The setting failed validation - might be due to duplicate keys
|
||||
pass
|
||||
|
||||
if setting and do_cache:
|
||||
# Cache this setting object
|
||||
|
||||
Reference in new issue
Block a user