Skip to content

Commit

Permalink
fix: [ACI-973] make config's 'rules' key optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii committed May 9, 2024
1 parent bd253c6 commit 95335a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion credentials/apps/badges/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/badges/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 95335a8

Please sign in to comment.