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
acb0ef85
Commit
acb0ef85
authored
Sep 15, 2015
by
Kelketek
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #524 from edx-solutions/private-discussions-fix
Private discussions fix
parents
2062df50
976c98bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletions
+35
-1
lms/djangoapps/django_comment_client/forum/tests.py
+27
-0
lms/djangoapps/django_comment_client/forum/views.py
+4
-1
lms/envs/aws.py
+4
-0
No files found.
lms/djangoapps/django_comment_client/forum/tests.py
View file @
acb0ef85
...
...
@@ -6,6 +6,7 @@ from django.core.urlresolvers import reverse
from
django.http
import
Http404
from
django.test.client
import
Client
,
RequestFactory
from
django.test.utils
import
override_settings
from
django_comment_client.forum.views
import
get_threads
from
edxmako.tests
import
mako_middleware_process_request
from
django_comment_client.forum
import
views
...
...
@@ -1337,3 +1338,29 @@ class EnrollmentTestCase(ModuleStoreTestCase):
request
.
user
=
self
.
student
with
self
.
assertRaises
(
UserNotEnrolled
):
views
.
forum_form_discussion
(
request
,
course_id
=
self
.
course
.
id
.
to_deprecated_string
())
class
ThreadListingTestCase
(
CohortedTestCase
):
"""
Test to make sure that queries for threads are only for those a user is allowed to view.
"""
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
def
test_index_send_id
(
self
,
_mock_request
):
request
=
RequestFactory
()
.
get
(
'dummy_url'
)
request
.
user
=
self
.
student
_threads
,
params
=
get_threads
(
request
,
self
.
course
)
self
.
assertEqual
(
params
[
'group_id'
],
self
.
student_cohort
.
id
)
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
def
test_cohorted_commentable_send_id
(
self
,
_mock_request
):
request
=
RequestFactory
()
.
get
(
'dummy_url'
)
request
.
user
=
self
.
student
_threads
,
params
=
get_threads
(
request
,
self
.
course
,
'cohorted_topic'
)
self
.
assertEqual
(
params
[
'group_id'
],
self
.
student_cohort
.
id
)
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
def
test_non_cohorted_commentable_does_not_send_id
(
self
,
_mock_request
):
request
=
RequestFactory
()
.
get
(
'dummy_url'
)
request
.
user
=
self
.
student
_threads
,
params
=
get_threads
(
request
,
self
.
course
,
'non_cohorted_topic'
)
self
.
assertNotIn
(
'group_id'
,
params
)
lms/djangoapps/django_comment_client/forum/views.py
View file @
acb0ef85
...
...
@@ -139,7 +139,10 @@ def get_threads(request, course, discussion_id=None, per_page=THREADS_PER_PAGE):
#if the user requested a group explicitly, give them that group, otherwise, if mod, show all, else if student, use cohort
is_cohorted
=
is_commentable_cohorted
(
course
.
id
,
discussion_id
)
if
discussion_id
:
is_cohorted
=
is_commentable_cohorted
(
course
.
id
,
discussion_id
)
else
:
is_cohorted
=
is_course_cohorted
(
course
.
id
)
if
has_permission
(
request
.
user
,
"see_all_cohorts"
,
course
.
id
):
group_id
=
request
.
GET
.
get
(
'group_id'
)
...
...
lms/envs/aws.py
View file @
acb0ef85
...
...
@@ -781,6 +781,10 @@ NOTIFICATION_EMAIL_FROM_ADDRESS = ENV_TOKENS.get(
'NOTIFICATION_EMAIL_FROM_ADDRESS'
,
NOTIFICATION_EMAIL_FROM_ADDRESS
)
NOTIFICATION_APP_HOSTNAME
=
ENV_TOKENS
.
get
(
'NOTIFICATION_APP_HOSTNAME'
,
SITE_NAME
)
NOTIFICATION_EMAIL_CLICK_LINK_ROOT
=
ENV_TOKENS
.
get
(
'NOTIFICATION_EMAIL_CLICK_LINK_ROOT'
,
NOTIFICATION_EMAIL_CLICK_LINK_ROOT
...
...
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