From 54d7743817fc64d920673e8659c202419e7451a1 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 27 Feb 2020 16:32:43 -0500 Subject: [PATCH] Don't iterate over an empty filters list. --- openedx/core/djangoapps/oauth_dispatch/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openedx/core/djangoapps/oauth_dispatch/models.py b/openedx/core/djangoapps/oauth_dispatch/models.py index e1ae9b2aeb..4aa4bb4f10 100644 --- a/openedx/core/djangoapps/oauth_dispatch/models.py +++ b/openedx/core/djangoapps/oauth_dispatch/models.py @@ -108,10 +108,11 @@ class ApplicationAccess(models.Model): @classmethod def get_filter_values(cls, application, filter_name): filters = cls.get_filters(application=application) - for filter_constraint in filters: - name, filter_value = filter_constraint.split(':', 1) - if name == filter_name: - yield filter_value + if filters: + for filter_constraint in filters: + name, filter_value = filter_constraint.split(':', 1) + if name == filter_name: + yield filter_value def __str__(self): """