Skip to content

Commit

Permalink
Added async with for mediator record delete
Browse files Browse the repository at this point in the history
  • Loading branch information
arin.hlaj committed Apr 28, 2022
1 parent 61f8734 commit 5337f2d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5337f2d

Please sign in to comment.