From 4af2249a9d960b1316e5d7bde1a20d1765c8f000 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 21 May 2014 14:28:04 -0400 Subject: [PATCH] Remove dead code --- .../djangoapps/django_comment_common/utils.py | 19 --------------- .../xmodule/xmodule/modulestore/mongo/base.py | 7 ------ .../courseware/tests/test_video_xml.py | 23 ------------------- lms/lib/comment_client/user.py | 3 --- 4 files changed, 52 deletions(-) diff --git a/common/djangoapps/django_comment_common/utils.py b/common/djangoapps/django_comment_common/utils.py index 9650401b65..2bc8aec97a 100644 --- a/common/djangoapps/django_comment_common/utils.py +++ b/common/djangoapps/django_comment_common/utils.py @@ -49,25 +49,6 @@ def seed_permissions_roles(course_key): administrator_role.inherit_permissions(moderator_role) -def _remove_permission_role(course_id, name): - try: - role = Role.objects.get(name=name, course_id=course_id) - if role.course_id == course_id: - role.delete() - except Role.DoesNotExist: - pass - - -def unseed_permissions_roles(course_id): - """ - A utility method to clean up all forum related permissions and roles - """ - _remove_permission_role(name="Administrator", course_id=course_id) - _remove_permission_role(name="Moderator", course_id=course_id) - _remove_permission_role(name="Community TA", course_id=course_id) - _remove_permission_role(name="Student", course_id=course_id) - - def are_permissions_roles_seeded(course_id): """ Returns whether the forums permissions for a course have been provisioned in diff --git a/common/lib/xmodule/xmodule/modulestore/mongo/base.py b/common/lib/xmodule/xmodule/modulestore/mongo/base.py index 2417e21ff8..274c97dd70 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo/base.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo/base.py @@ -41,13 +41,6 @@ from xmodule.modulestore.locations import SlashSeparatedCourseKey log = logging.getLogger(__name__) -def get_course_id_no_run(location): - ''' - Return the first two components of the course_id for this location (org/course) - ''' - return "/".join([location.org, location.course]) - - class InvalidWriteError(Exception): """ Raised to indicate that writing to a particular key diff --git a/lms/djangoapps/courseware/tests/test_video_xml.py b/lms/djangoapps/courseware/tests/test_video_xml.py index cea2bc865c..1c567e2ae5 100644 --- a/lms/djangoapps/courseware/tests/test_video_xml.py +++ b/lms/djangoapps/courseware/tests/test_video_xml.py @@ -37,29 +37,6 @@ SOURCE_XML = """ """ -class VideoFactory(object): - """A helper class to create video modules with various parameters - for testing. - """ - - # tag that uses youtube videos - sample_problem_xml_youtube = SOURCE_XML - - @staticmethod - def create(): - """Method return Video Xmodule instance.""" - location = Location(["i4x", "edX", "video", "default", - "SampleProblem1"]) - field_data = {'data': VideoFactory.sample_problem_xml_youtube, - 'location': location} - - system = get_test_descriptor_system() - - descriptor = VideoDescriptor(system, DictFieldData(field_data), ScopeIds(None, None, None, None)) - descriptor.xmodule_runtime = get_test_system() - return descriptor - - class VideoModuleLogicTest(LogicTest): """Tests for logic of Video Xmodule.""" diff --git a/lms/lib/comment_client/user.py b/lms/lib/comment_client/user.py index 7d946c1330..5e617f5c46 100644 --- a/lms/lib/comment_client/user.py +++ b/lms/lib/comment_client/user.py @@ -163,7 +163,4 @@ def _url_for_user_active_threads(user_id): def _url_for_user_subscribed_threads(user_id): return "{prefix}/users/{user_id}/subscribed_threads".format(prefix=settings.PREFIX, user_id=user_id) -def _url_for_user_stats(user_id,course_id): - return "{prefix}/users/{user_id}/stats?course_id={course_id}".format(prefix=settings.PREFIX, user_id=user_id,course_id=course_id) -