fix: remove incorrect key type when filtering inaccessible blocks

Returning the list with a 'completion' string was added in 9bc0f85. However,
the `get_accessible_sequences` method expects a list of dicts with an 'id' key.
This commit is contained in:
Agrendalath
2024-09-07 14:54:03 +02:00
committed by Farhaan Bukhsh
parent 9a6cdbf8e2
commit 8b7a771dc4

View File

@@ -501,7 +501,7 @@ class CourseNavigationBlocksView(RetrieveAPIView):
for section_data in course_sections:
section_data['children'] = self.get_accessible_sequences(
user_course_outline,
section_data.get('children', ['completion'])
section_data.get('children', [])
)
accessible_sequence_ids = {str(usage_key) for usage_key in user_course_outline.accessible_sequences}
for sequence_data in section_data['children']: