From 755045b22667ffa9b7830f446c9f052230bbadd4 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 11 Apr 2019 15:30:07 +0200 Subject: [PATCH] try to fix app_gw being null --- passbook/app_gw/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passbook/app_gw/middleware.py b/passbook/app_gw/middleware.py index d1a064308..53ab5d617 100644 --- a/passbook/app_gw/middleware.py +++ b/passbook/app_gw/middleware.py @@ -77,10 +77,10 @@ class ApplicationGatewayMiddleware: try: # Check if ApplicationGateway is associated with application getattr(app_gw, 'application') - return False, app_gw + if app_gw: + return False, app_gw except Application.DoesNotExist: LOGGER.debug("ApplicationGateway not associated with Application") - return True, None return True, None def __call__(self, request):