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
b0894c39
Commit
b0894c39
authored
Aug 21, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for other courses - create default discussion roles on demand if they don't exist
parent
b31722bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lms/djangoapps/django_comment_client/permissions.py
+2
-2
lms/templates/courseware/courseware.html
+1
-1
No files found.
lms/djangoapps/django_comment_client/permissions.py
View file @
b0894c39
...
...
@@ -11,9 +11,9 @@ from util.cache import cache
@receiver
(
post_save
,
sender
=
CourseEnrollment
)
def
assign_default_role
(
sender
,
instance
,
**
kwargs
):
if
instance
.
user
.
is_staff
:
role
=
Role
.
objects
.
get
(
course_id
=
instance
.
course_id
,
name
=
"Moderator"
)
role
=
Role
.
objects
.
get
_or_create
(
course_id
=
instance
.
course_id
,
name
=
"Moderator"
)[
0
]
else
:
role
=
Role
.
objects
.
get
(
course_id
=
instance
.
course_id
,
name
=
"Student"
)
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
))
instance
.
user
.
roles
.
add
(
role
)
...
...
lms/templates/courseware/courseware.html
View file @
b0894c39
...
...
@@ -21,7 +21,7 @@
<
%
static:js
group=
'courseware'
/>
<
%
include
file=
"discussion/_js_dependencies.html"
/>
<
%
include
file=
"
../
discussion/_js_dependencies.html"
/>
<
%
include
file=
"/mathjax_include.html"
/>
<!-- TODO: http://docs.jquery.com/Plugins/Validation -->
...
...
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