From 00f4ea3fc348c75c8a8514884473c3ab02710073 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 29 Jul 2020 20:44:43 -0400 Subject: [PATCH] fix keyerror with request.session (#24642) * fix keyerror with request.session * improve the conditional --- openedx/features/enterprise_support/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/features/enterprise_support/api.py b/openedx/features/enterprise_support/api.py index 45b1df59c3..8cb1e7133c 100644 --- a/openedx/features/enterprise_support/api.py +++ b/openedx/features/enterprise_support/api.py @@ -582,7 +582,7 @@ def get_enterprise_learner_portal_enabled_message(request): Args: request: request made to the LMS dashboard """ - if request.session['enterprise_customer']: + if 'enterprise_customer' in request.session and request.session['enterprise_customer']: enterprise_customer = request.session['enterprise_customer'] else: learner_data = get_enterprise_learner_data(request.user)