From a5c957ef563b81b6aac511fdf8396cb99b5c0e79 Mon Sep 17 00:00:00 2001 From: Serg Melikyan Date: Tue, 16 Jul 2013 11:16:44 +0400 Subject: [PATCH] Resolved issue with session delete Change-Id: Iad13b4f9e921f7dce899df1a79b7617a71327dae --- muranoapi/api/v1/sessions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/muranoapi/api/v1/sessions.py b/muranoapi/api/v1/sessions.py index 6ba243a3..741c675c 100644 --- a/muranoapi/api/v1/sessions.py +++ b/muranoapi/api/v1/sessions.py @@ -71,6 +71,11 @@ class Controller(object): unit = get_session() session = unit.query(Session).get(session_id) + if session is None: + log.error('Session is not found' + ''.format(session_id)) + raise exc.HTTPNotFound() + if session.environment_id != environment_id: log.error('Session is not tied with Environment ' ''.format(session_id, environment_id))