Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
notifier
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
notifier
Commits
ee7829a8
Unverified
Commit
ee7829a8
authored
Jan 31, 2018
by
Hasnain Naveed
Committed by
GitHub
Jan 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #51 from edx/hasnain-naveed/WL-1403
WL-1403 | suppressing digest notification for WL-sites.
parents
6c35cf11
31c393b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
notifier/pull.py
+29
-17
No files found.
notifier/pull.py
View file @
ee7829a8
...
...
@@ -69,6 +69,15 @@ def _build_digest(user_content, user_info):
)
)
def
_should_skip_org
(
course_id
):
# TODO: Need to implement an end point in LMS to get this list.
orgs_to_skip
=
[
"WhartonOnlineProfessionalEd"
]
skip_course
=
False
for
org
in
orgs_to_skip
:
if
org
in
course_id
:
skip_course
=
True
return
skip_course
def
_build_digest_course
(
course_id
,
course_content
,
user_course_info
):
"""
Transforms thread/item data from the comments service's response for a
...
...
@@ -76,23 +85,26 @@ def _build_digest_course(course_id, course_content, user_course_info):
The threads returned will be filtered by a group-level access check.
"""
return
DigestCourse
(
course_id
,
[
_build_digest_thread
(
thread_id
,
course_id
,
thread_content
)
for
thread_id
,
thread_content
in
course_content
.
iteritems
()
if
(
# the user is allowed to "see all cohorts" in the course, or
user_course_info
[
'see_all_cohorts'
]
or
# the thread is not associated with a group, or
thread_content
.
get
(
'group_id'
)
is
None
or
# the user's cohort_id matches the thread's group_id
user_course_info
[
'cohort_id'
]
==
thread_content
.
get
(
'group_id'
)
)
]
)
if
_should_skip_org
(
course_id
):
return
DigestCourse
(
course_id
,
[])
else
:
return
DigestCourse
(
course_id
,
[
_build_digest_thread
(
thread_id
,
course_id
,
thread_content
)
for
thread_id
,
thread_content
in
course_content
.
iteritems
()
if
(
# the user is allowed to "see all cohorts" in the course, or
user_course_info
[
'see_all_cohorts'
]
or
# the thread is not associated with a group, or
thread_content
.
get
(
'group_id'
)
is
None
or
# the user's cohort_id matches the thread's group_id
user_course_info
[
'cohort_id'
]
==
thread_content
.
get
(
'group_id'
)
)
]
)
def
_build_digest_thread
(
thread_id
,
course_id
,
thread_content
):
"""
...
...
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