mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +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):
|
except (IntegrityError, OperationalError):
|
||||||
# It might be the case that the database isn't created yet
|
# It might be the case that the database isn't created yet
|
||||||
pass
|
pass
|
||||||
|
except ValidationError:
|
||||||
|
# The setting failed validation - might be due to duplicate keys
|
||||||
|
pass
|
||||||
|
|
||||||
if setting and do_cache:
|
if setting and do_cache:
|
||||||
# Cache this setting object
|
# Cache this setting object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user