From a76f61eb2a26ee9605fe18a455430154e6e11f82 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Tue, 4 Feb 2020 16:42:27 -0500 Subject: [PATCH] Check if view_args is not None to prevent KeyError --- atst/utils/context_processors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/atst/utils/context_processors.py b/atst/utils/context_processors.py index 7d39b367..5bb4771d 100644 --- a/atst/utils/context_processors.py +++ b/atst/utils/context_processors.py @@ -19,6 +19,9 @@ from atst.models import ( def get_resources_from_context(view_args): query = None + if view_args is None: + view_args = {} + if "portfolio_token" in view_args: query = ( db.session.query(Portfolio)