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
8d0eb7f1
Commit
8d0eb7f1
authored
Nov 26, 2012
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond to feedback (esp. use of .format())
parent
3b29ab37
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
46 deletions
+35
-46
lms/djangoapps/django_comment_client/models.py
+5
-4
lms/djangoapps/django_comment_client/utils.py
+6
-8
lms/djangoapps/instructor/tests.py
+24
-34
lms/djangoapps/instructor/views.py
+0
-0
No files found.
lms/djangoapps/django_comment_client/models.py
View file @
8d0eb7f1
import
logging
from
django.db
import
models
from
django.contrib.auth.models
import
User
import
logging
from
courseware.courses
import
get_course_by_id
...
...
@@ -20,8 +21,8 @@ class Role(models.Model):
def
inherit_permissions
(
self
,
role
):
# TODO the name of this method is a little bit confusing,
# since it's one-off and doesn't handle inheritance later
if
role
.
course_id
and
role
.
course_id
!=
self
.
course_id
:
logging
.
warning
(
"
%
s cannot inherit permissions from
%
s due to course_id inconsistency"
%
(
self
,
role
)
)
logging
.
warning
(
"
{0} cannot inherit permissions from {1} due to course_id inconsistency"
,
\
self
,
role
)
for
per
in
role
.
permissions
.
all
():
self
.
add_permission
(
per
)
...
...
@@ -30,7 +31,7 @@ class Role(models.Model):
def
has_permission
(
self
,
permission
):
course
=
get_course_by_id
(
self
.
course_id
)
if
self
.
name
==
"Student"
and
\
if
self
.
name
==
FORUM_ROLE_STUDENT
and
\
(
permission
.
startswith
(
'edit'
)
or
permission
.
startswith
(
'update'
)
or
permission
.
startswith
(
'create'
))
and
\
(
not
course
.
forum_posts_allowed
):
return
False
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
8d0eb7f1
from
collections
import
defaultdict
import
logging
import
time
import
urllib
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.db
import
connection
...
...
@@ -7,15 +11,11 @@ from django.utils import simplejson
from
django_comment_client.models
import
Role
from
django_comment_client.permissions
import
check_permissions_by_view
from
mitxmako
import
middleware
import
pystache_custom
as
pystache
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.search
import
path_to_location
import
logging
import
pystache_custom
as
pystache
import
time
import
urllib
# TODO these should be cached via django's caching rather than in-memory globals
...
...
@@ -133,8 +133,6 @@ def initialize_discussion_info(course):
return
course_id
=
course
.
id
# url_course_id = course_id.replace('/', '_').replace('.', '_')
all_modules
=
get_full_modules
()[
course_id
]
discussion_id_map
=
{}
...
...
lms/djangoapps/instructor/tests.py
View file @
8d0eb7f1
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor/views.py
View file @
8d0eb7f1
This diff is collapsed.
Click to expand it.
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