Commit d9362ee2 by Cory Lee

Revert "WL-1403 | suppressing digest notification for WL-sites."

This reverts commit 31c393b0.
parent ee7829a8
...@@ -69,15 +69,6 @@ def _build_digest(user_content, user_info): ...@@ -69,15 +69,6 @@ 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): def _build_digest_course(course_id, course_content, user_course_info):
""" """
Transforms thread/item data from the comments service's response for a Transforms thread/item data from the comments service's response for a
...@@ -85,26 +76,23 @@ def _build_digest_course(course_id, course_content, user_course_info): ...@@ -85,26 +76,23 @@ def _build_digest_course(course_id, course_content, user_course_info):
The threads returned will be filtered by a group-level access check. The threads returned will be filtered by a group-level access check.
""" """
if _should_skip_org(course_id): return DigestCourse(
return DigestCourse(course_id, []) course_id,
else: [
return DigestCourse( _build_digest_thread(thread_id, course_id, thread_content)
course_id, for thread_id, thread_content in course_content.iteritems()
[ if (
_build_digest_thread(thread_id, course_id, thread_content) # the user is allowed to "see all cohorts" in the course, or
for thread_id, thread_content in course_content.iteritems() user_course_info['see_all_cohorts'] or
if (
# the user is allowed to "see all cohorts" in the course, or # the thread is not associated with a group, or
user_course_info['see_all_cohorts'] or thread_content.get('group_id') is None or
# the thread is not associated with a group, or # the user's cohort_id matches the thread's group_id
thread_content.get('group_id') is None or user_course_info['cohort_id'] == thread_content.get('group_id')
)
# 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): def _build_digest_thread(thread_id, course_id, thread_content):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment