Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
3853c926
Commit
3853c926
authored
Dec 05, 2013
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1850 from edx/gprice/change-staff-forum-role
Change forum role granted to staff on enrollment
parents
f7d86bff
88610cb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
CHANGELOG.rst
+4
-0
common/djangoapps/django_comment_common/models.py
+2
-7
common/djangoapps/django_comment_common/tests.py
+3
-7
No files found.
CHANGELOG.rst
View file @
3853c926
...
...
@@ -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
...
...
common/djangoapps/django_comment_common/models.py
View file @
3853c926
...
...
@@ -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
)
...
...
common/djangoapps/django_comment_common/tests.py
View file @
3853c926
...
...
@@ -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
.
assert
In
(
student_role
,
self
.
student_user
.
roles
.
all
(
))
self
.
assert
NotIn
(
moderator_role
,
self
.
student_user
.
roles
.
all
(
))
self
.
assert
Equal
([
student_role
],
list
(
self
.
staff_user
.
roles
.
all
()
))
self
.
assert
Equal
([
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment