diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b54d0b622f..a62b0fb009 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,10 @@ Common: Switch over from MITX_FEATURES to just FEATURES. To override items in the FEATURES dict, the environment variable you must set to do so is also now called FEATURES instead of MITX_FEATURES. +LMS: Change the forum role granted to global staff on enrollment in a +course. Previously, staff were given the Moderator role; now, they are +given the Student role. + Blades: Fix Numerical input to support mathematical operations. BLD-525. Blades: Improve calculator's tooltip accessibility. Add possibility to navigate diff --git a/common/djangoapps/django_comment_common/models.py b/common/djangoapps/django_comment_common/models.py index 7878f1b453..c345f26919 100644 --- a/common/djangoapps/django_comment_common/models.py +++ b/common/djangoapps/django_comment_common/models.py @@ -32,13 +32,8 @@ def assign_default_role(sender, instance, **kwargs): # instance.user.roles.remove(*course_roles) # return - # We've enrolled the student, so make sure they have a default role - if instance.user.is_staff: - role = Role.objects.get_or_create(course_id=instance.course_id, name="Moderator")[0] - else: - role = Role.objects.get_or_create(course_id=instance.course_id, name="Student")[0] - - logging.info("assign_default_role: adding %s as %s" % (instance.user, role)) + # We've enrolled the student, so make sure they have the Student role + role = Role.objects.get_or_create(course_id=instance.course_id, name="Student")[0] instance.user.roles.add(role) diff --git a/common/djangoapps/django_comment_common/tests.py b/common/djangoapps/django_comment_common/tests.py index 47790f1e1e..fd776c75d3 100644 --- a/common/djangoapps/django_comment_common/tests.py +++ b/common/djangoapps/django_comment_common/tests.py @@ -10,6 +10,7 @@ class RoleAssignmentTest(TestCase): """ def setUp(self): + # Check a staff account because those used to get the Moderator role self.staff_user = User.objects.create_user( "patty", "patty@fake.edx.org", @@ -25,18 +26,13 @@ class RoleAssignmentTest(TestCase): CourseEnrollment.enroll(self.student_user, self.course_id) def test_enrollment_auto_role_creation(self): - moderator_role = Role.objects.get( - course_id=self.course_id, - name="Moderator" - ) student_role = Role.objects.get( course_id=self.course_id, name="Student" ) - self.assertIn(moderator_role, self.staff_user.roles.all()) - self.assertIn(student_role, self.student_user.roles.all()) - self.assertNotIn(moderator_role, self.student_user.roles.all()) + self.assertEqual([student_role], list(self.staff_user.roles.all())) + self.assertEqual([student_role], list(self.student_user.roles.all())) # The following was written on the assumption that unenrolling from a course # should remove all forum Roles for that student for that course. This is