Skip to content

Commit

Permalink
chore: pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Sep 3, 2024
1 parent 1020939 commit 94ac24a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions enterprise_access/apps/content_assignments/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class LearnerContentAssignmentAdmin(DjangoQLSearchMixin, SimpleHistoryAdmin):
'lms_user_id',
'get_enterprise_customer_uuid',
'preferred_course_run_key',
'parent_content_key',
'is_assigned_course_run',
)
autocomplete_fields = ['assignment_configuration']
Expand Down
12 changes: 6 additions & 6 deletions enterprise_access/apps/content_assignments/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ def _get_content_title(assignment_configuration, content_key):
"""
Helper to retrieve (from cache) the title of a content_key'ed content_metadata
"""
content_metadata = _get_content_summary(assignment_configuration, content_key)
return content_metadata.get('content_title')
course_content_metadata = _get_content_summary(assignment_configuration, content_key)
return course_content_metadata.get('content_title')


def _get_parent_content_key(assignment_configuration, content_key):
Expand All @@ -534,8 +534,8 @@ def _get_parent_content_key(assignment_configuration, content_key):
If content_key is for a course key, this will return the same key. Otherwise, the content_key
represents a course run, and this will return the run's parent course key.
"""
content_metadata = _get_content_summary(assignment_configuration, content_key)
metadata_content_key = content_metadata.get('content_key')
course_content_metadata = _get_content_summary(assignment_configuration, content_key)
metadata_content_key = course_content_metadata.get('content_key')

# Check if the assignment's content_key matches the returned content_key. If so, this is a course key
# which has no parent key.
Expand All @@ -555,8 +555,8 @@ def _get_preferred_course_run_key(assignment_configuration, content_key):
Returns:
The preferred course run key (from cache) of a content_key'ed content_metadata
"""
content_metadata = _get_content_summary(assignment_configuration, content_key)
return content_metadata.get('course_run_key')
course_content_metadata = _get_content_summary(assignment_configuration, content_key)
return course_content_metadata.get('course_run_key')


def _create_new_assignments(
Expand Down

0 comments on commit 94ac24a

Please sign in to comment.