From fd50d5105a4048d7f6aeea3ba95934093f8b483d Mon Sep 17 00:00:00 2001 From: Serg Melikyan Date: Tue, 16 Jul 2013 11:22:41 +0400 Subject: [PATCH] Resolved MRN-576 Change-Id: Idafc987bdc847c39571df07240a62bebd2328703 --- muranoapi/api/v1/sessions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/muranoapi/api/v1/sessions.py b/muranoapi/api/v1/sessions.py index 6ba243a3..a1e0b47d 100644 --- a/muranoapi/api/v1/sessions.py +++ b/muranoapi/api/v1/sessions.py @@ -48,6 +48,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)) @@ -98,6 +103,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))