|
93 | 93 | use_new_updates_page, |
94 | 94 | use_new_advanced_settings_page, |
95 | 95 | use_new_grading_page, |
96 | | - use_new_textbooks_page, |
97 | 96 | use_new_group_configurations_page, |
98 | 97 | use_new_schedule_details_page |
99 | 98 | ) |
|
112 | 111 | get_schedule_details_url, |
113 | 112 | get_studio_home_url, |
114 | 113 | get_updates_url, |
115 | | - get_textbooks_context, |
116 | 114 | get_textbooks_url, |
117 | 115 | initialize_permissions, |
118 | 116 | remove_all_instructors, |
@@ -1457,17 +1455,18 @@ def textbooks_list_handler(request, course_key_string): |
1457 | 1455 | json: overwrite all textbooks in the course with the given list |
1458 | 1456 | """ |
1459 | 1457 | course_key = CourseKey.from_string(course_key_string) |
| 1458 | + if "application/json" not in request.META.get('HTTP_ACCEPT', 'text/html'): |
| 1459 | + # return HTML page |
| 1460 | + # We don't need to do an access check here because |
| 1461 | + # that is done when the endpoint for the actual content of the page. |
| 1462 | + # This is just to handle redirecting anyone that has bookmarked the old |
| 1463 | + # textbooks page. |
| 1464 | + return redirect(get_textbooks_url(course_key)) |
| 1465 | + |
1460 | 1466 | store = modulestore() |
1461 | 1467 | with store.bulk_operations(course_key): |
1462 | 1468 | course = get_course_and_check_access(course_key, request.user) |
1463 | 1469 |
|
1464 | | - if "application/json" not in request.META.get('HTTP_ACCEPT', 'text/html'): |
1465 | | - # return HTML page |
1466 | | - if use_new_textbooks_page(course_key): |
1467 | | - return redirect(get_textbooks_url(course_key)) |
1468 | | - textbooks_context = get_textbooks_context(course) |
1469 | | - return render_to_response('textbooks.html', textbooks_context) |
1470 | | - |
1471 | 1470 | # from here on down, we know the client has requested JSON |
1472 | 1471 | if request.method == 'GET': |
1473 | 1472 | return JsonResponse(course.pdf_textbooks) |
|
0 commit comments