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
c2d1791d
Commit
c2d1791d
authored
Aug 19, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it so that students who are not enrolled cannot see the forum
parent
2a24d649
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lms/djangoapps/django_comment_client/forum/views.py
+6
-0
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
c2d1791d
...
...
@@ -12,6 +12,7 @@ from courseware.courses import get_course_with_access
from
course_groups.cohorts
import
(
is_course_cohorted
,
get_cohort_id
,
is_commentable_cohorted
,
get_cohorted_commentables
,
get_course_cohorts
,
get_cohort_by_id
)
from
courseware.access
import
has_access
from
student.models
import
CourseEnrollment
from
django_comment_client.permissions
import
cached_has_permission
from
django_comment_client.utils
import
(
merge_dict
,
extract
,
strip_none
,
get_courseware_context
)
...
...
@@ -168,6 +169,11 @@ def forum_form_discussion(request, course_id):
"""
Renders the main Discussion page, potentially filtered by a search query
"""
if
not
CourseEnrollment
.
is_enrolled
(
request
.
user
,
course_id
):
access_violation_msg
=
"Unenrolled user {} tried to access forum for {}"
log
.
warning
(
access_violation_msg
.
format
(
request
.
user
,
course_id
))
raise
Http404
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
category_map
=
utils
.
get_discussion_category_map
(
course
)
...
...
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