mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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:
parent
63da2ae9f7
commit
5992dcdfda
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user