Merge pull request #3809 from cpennington/ok-dead-code
Remove dead code
This commit is contained in:
@@ -49,25 +49,6 @@ def seed_permissions_roles(course_key):
|
|||||||
administrator_role.inherit_permissions(moderator_role)
|
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):
|
def are_permissions_roles_seeded(course_id):
|
||||||
"""
|
"""
|
||||||
Returns whether the forums permissions for a course have been provisioned in
|
Returns whether the forums permissions for a course have been provisioned in
|
||||||
|
|||||||
@@ -41,13 +41,6 @@ from xmodule.modulestore.locations import SlashSeparatedCourseKey
|
|||||||
log = logging.getLogger(__name__)
|
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):
|
class InvalidWriteError(Exception):
|
||||||
"""
|
"""
|
||||||
Raised to indicate that writing to a particular key
|
Raised to indicate that writing to a particular key
|
||||||
|
|||||||
@@ -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):
|
class VideoModuleLogicTest(LogicTest):
|
||||||
"""Tests for logic of Video Xmodule."""
|
"""Tests for logic of Video Xmodule."""
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,4 @@ def _url_for_user_active_threads(user_id):
|
|||||||
def _url_for_user_subscribed_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)
|
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)
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user