mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2026-04-26 22:22:30 +02:00
This commit is contained in:
@@ -233,7 +233,7 @@ def create_interface():
|
|||||||
try:
|
try:
|
||||||
create_entry(form, user)
|
create_entry(form, user)
|
||||||
except IntegrityError as e:
|
except IntegrityError as e:
|
||||||
session.rollback()
|
db.session.rollback()
|
||||||
# TODO: this only works for PG
|
# TODO: this only works for PG
|
||||||
if isinstance(e.orig, UniqueViolation):
|
if isinstance(e.orig, UniqueViolation):
|
||||||
return ("A service with this name already exists (possibly by another user)", 409)
|
return ("A service with this name already exists (possibly by another user)", 409)
|
||||||
@@ -366,7 +366,7 @@ def default():
|
|||||||
try:
|
try:
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
except IntegrityError as e:
|
except IntegrityError as e:
|
||||||
session.rollback()
|
db.session.rollback()
|
||||||
# TODO: this only works for PG
|
# TODO: this only works for PG
|
||||||
if isinstance(e.orig, UniqueViolation):
|
if isinstance(e.orig, UniqueViolation):
|
||||||
return ("Status at this time already submitted", 409)
|
return ("Status at this time already submitted", 409)
|
||||||
|
|||||||
Reference in New Issue
Block a user