From d827805016ce7123f8ccb6ee0beb568c5ea8685f Mon Sep 17 00:00:00 2001 From: Laura Cox <31892318+Laura-Danielle@users.noreply.github.com> Date: Thu, 26 Mar 2020 18:58:10 -0400 Subject: [PATCH] refactor(api): Add success message to delete endpoint (#5299) --- api/src/opentrons/server/endpoints/calibration/check.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/src/opentrons/server/endpoints/calibration/check.py b/api/src/opentrons/server/endpoints/calibration/check.py index 69b30a9dbd7..6c08aa326dc 100644 --- a/api/src/opentrons/server/endpoints/calibration/check.py +++ b/api/src/opentrons/server/endpoints/calibration/check.py @@ -65,7 +65,7 @@ async def create_session(request): """ session_type = request.match_info['type'] if session_type not in ALLOWED_SESSIONS: - message = f'Session of type {session_type} is not supported' + message = f"Session of type {session_type} is not supported." return web.json_response(message, status=403) session_storage = request.app['com.opentrons.session_manager'] @@ -96,9 +96,10 @@ async def delete_session(request): session_storage = request.app['com.opentrons.session_manager'] current_session = session_storage.sessions.get(session_type) if not current_session: - response = {'message': f'A {session_type} session does not exist.'} + response = {"message": f"A {session_type} session does not exist."} return web.json_response(response, status=404) else: await current_session.hardware.home() del session_storage.sessions[session_type] - return web.json_response(status=200) + response = {'message': f"Successfully deleted {session_type} session."} + return web.json_response(response, status=200)