From 5337f2d9bda8e90e79018d7007f5a9c30548eeb8 Mon Sep 17 00:00:00 2001 From: "arin.hlaj" Date: Thu, 28 Apr 2022 11:19:16 +0200 Subject: [PATCH] Added async with for mediator record delete --- aries_cloudagent/protocols/coordinate_mediation/v1_0/routes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aries_cloudagent/protocols/coordinate_mediation/v1_0/routes.py b/aries_cloudagent/protocols/coordinate_mediation/v1_0/routes.py index 6740dce76b..3435174712 100644 --- a/aries_cloudagent/protocols/coordinate_mediation/v1_0/routes.py +++ b/aries_cloudagent/protocols/coordinate_mediation/v1_0/routes.py @@ -246,7 +246,8 @@ async def delete_mediation_request(request: web.BaseRequest): session, mediation_id ) result = mediation_record.serialize() - await mediation_record.delete_record(session) + async with context.profile.session() as session: + await mediation_record.delete_record(session) except StorageNotFoundError as err: raise web.HTTPNotFound(reason=err.roll_up) from err except (BaseModelError, StorageError) as err: