add delete functions for inbound and callback api objects

Both service api tasks work fine if the object is unexpectedly deleted
halfway through - they both check to see if the api details are still
in the DB before trying to send the request.
This commit is contained in:
Leo Hemsted
2018-07-05 11:09:17 +01:00
parent 4502dffa13
commit 32415b3b14
5 changed files with 155 additions and 74 deletions

View File

@@ -32,3 +32,8 @@ def get_service_callback_api(service_callback_api_id, service_id):
def get_service_callback_api_for_service(service_id):
return ServiceCallbackApi.query.filter_by(service_id=service_id).first()
@transactional
def delete_service_callback_api(service_callback_api):
db.session.delete(service_callback_api)

View File

@@ -33,3 +33,8 @@ def get_service_inbound_api(service_inbound_api_id, service_id):
def get_service_inbound_api_for_service(service_id):
return ServiceInboundApi.query.filter_by(service_id=service_id).first()
@transactional
def delete_service_inbound_api(service_inbound_api):
db.session.delete(service_inbound_api)