Skip to content

Commit

Permalink
fix: hide new library button for ineligible users in split studio view (
Browse files Browse the repository at this point in the history
#675)

(cherry picked from commit 661ee89)
  • Loading branch information
kaustavb12 authored and viadanna committed Sep 3, 2024
1 parent bd9b79f commit d7c0068
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ def get_library_context(request, request_is_json=False):
)
from cms.djangoapps.contentstore.views.library import (
LIBRARIES_ENABLED,
user_can_create_library,
)

libraries = _accessible_libraries_iter(request.user) if LIBRARIES_ENABLED else []
Expand All @@ -1547,7 +1548,7 @@ def get_library_context(request, request_is_json=False):
'in_process_course_actions': [],
'courses': [],
'libraries_enabled': LIBRARIES_ENABLED,
'show_new_library_button': LIBRARIES_ENABLED and request.user.is_active,
'show_new_library_button': user_can_create_library(request.user) and request.user.is_active,
'user': request.user,
'request_course_creator_url': reverse('request_course_creator'),
'course_creator_status': _get_course_creator_status(request.user),
Expand Down

0 comments on commit d7c0068

Please sign in to comment.