mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 18:15:40 +00:00
Fix try statement
This commit is contained in:
@ -291,6 +291,8 @@ class InvenTreeSetting(models.Model):
|
||||
|
||||
setting = InvenTreeSetting(key=key, value=InvenTreeSetting.get_setting_default(key))
|
||||
|
||||
try:
|
||||
# Wrap this statement in "atomic", so it can be rolled back if it fails
|
||||
with transaction.atomic():
|
||||
setting.save()
|
||||
except (IntegrityError, OperationalError):
|
||||
|
Reference in New Issue
Block a user