diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 75a8d8db1c..819f65fca6 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -27,8 +27,6 @@ from .module_render import toc_for_course, get_module_for_descriptor, get_module from courseware.models import StudentModule, StudentModuleHistory from course_modes.models import CourseMode -from django_comment_client.utils import get_discussion_title - from student.models import UserTestGroup, CourseEnrollment from util.cache import cache, cache_if_anonymous from xblock.fragment import Fragment @@ -39,8 +37,6 @@ from xmodule.modulestore.search import path_to_location from xmodule.course_module import CourseDescriptor import shoppingcart -import comment_client - log = logging.getLogger("mitx.courseware") template_imports = {'urllib': urllib} @@ -674,29 +670,6 @@ def mktg_course_about(request, course_id): }) -def render_notifications(request, course, notifications): - context = { - 'notifications': notifications, - 'get_discussion_title': partial(get_discussion_title, request=request, course=course), - 'course': course, - } - return render_to_string('courseware/notifications.html', context) - - -@login_required -def news(request, course_id): - course = get_course_with_access(request.user, course_id, 'load') - - notifications = comment_client.get_notifications(request.user.id) - - context = { - 'course': course, - 'content': render_notifications(request, course, notifications), - } - - return render_to_response('courseware/news.html', context) - - @login_required @cache_control(no_cache=True, no_store=True, must_revalidate=True) def progress(request, course_id, student_id=None): diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index d449f288a4..3e0699f2ef 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -20,8 +20,6 @@ from django.utils.timezone import UTC log = logging.getLogger(__name__) -# TODO these should be cached via django's caching rather than in-memory globals -_FULLMODULES = None _DISCUSSIONINFO = defaultdict(dict) @@ -62,13 +60,6 @@ def has_forum_access(uname, course_id, rolename): return role.users.filter(username=uname).exists() -def get_full_modules(): - global _FULLMODULES - if not _FULLMODULES: - _FULLMODULES = modulestore().modules - return _FULLMODULES - - def get_discussion_id_map(course): """ return a dict of the form {category: modules} @@ -77,12 +68,6 @@ def get_discussion_id_map(course): return _DISCUSSIONINFO[course.id]['id_map'] -def get_discussion_title(course, discussion_id): - initialize_discussion_info(course) - title = _DISCUSSIONINFO[course.id]['id_map'].get(discussion_id, {}).get('title', '(no title)') - return title - - def get_discussion_category_map(course): initialize_discussion_info(course) return filter_unstarted_categories(_DISCUSSIONINFO[course.id]['category_map']) diff --git a/lms/templates/courseware/notifications.html b/lms/templates/courseware/notifications.html deleted file mode 100644 index 39eaaa14b9..0000000000 --- a/lms/templates/courseware/notifications.html +++ /dev/null @@ -1,93 +0,0 @@ -<%! from django.utils.translation import ugettext as _ %> -<%! from django.core.urlresolvers import reverse %> - -<% -def url_for_thread(discussion_id, thread_id): - return reverse('django_comment_client.forum.views.single_thread', args=[course.id, discussion_id, thread_id]) -%> - -<% -def url_for_comment(discussion_id, thread_id, comment_id): - return url_for_thread(discussion_id, thread_id) + "#" + comment_id -%> - -<% -def url_for_discussion(discussion_id): - return reverse('django_comment_client.forum.views.forum_form_discussion', args=[course.id, discussion_id]) -%> - -<% -def discussion_title(discussion_id): - return get_discussion_title(discussion_id=discussion_id) -%> - -<% -def url_for_user(user_id): #TODO - return "javascript:void(0)" -%> - - -