diff --git a/credentials/apps/badges/tests/test_utils.py b/credentials/apps/badges/tests/test_utils.py index 69311c5e1..211b5bc02 100644 --- a/credentials/apps/badges/tests/test_utils.py +++ b/credentials/apps/badges/tests/test_utils.py @@ -164,7 +164,7 @@ class TestGetEventTypeKeypaths(unittest.TestCase): def test_get_event_type_keypaths(self): result = get_event_type_keypaths("org.openedx.learning.course.passing.status.updated.v1") - for ignored_keypath in settings.BADGES_CONFIG["rules"].get("ignored_keypaths", []): + for ignored_keypath in settings.BADGES_CONFIG.get("rules", {}).get("ignored_keypaths", []): self.assertNotIn(ignored_keypath, result) class TestGetCredlyBaseUrl(unittest.TestCase): diff --git a/credentials/apps/badges/utils.py b/credentials/apps/badges/utils.py index 5ae9f62e2..fb331982e 100644 --- a/credentials/apps/badges/utils.py +++ b/credentials/apps/badges/utils.py @@ -152,7 +152,7 @@ def get_data_keypaths(data): f"{field.name}.{keypath}" for keypath in get_data_keypaths(field.type) if f"{field.name}.{keypath}" - not in settings.BADGES_CONFIG["rules"].get("ignored_keypaths", []) + not in settings.BADGES_CONFIG.get("rules", {}).get("ignored_keypaths", []) ] else: keypaths.append(field.name)