Commit 4a3b8911 by Zia Fazal

cherry picked commit c5a7ca3

parent 96081f71
......@@ -6,8 +6,8 @@ from django.contrib.auth.models import User
from xmodule.modulestore.django import modulestore
from xmodule.course_module import CourseDescriptor
from course_groups.models import CourseUserGroup
from course_groups.cohorts import (
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
from openedx.core.djangoapps.course_groups.cohorts import (
get_cohort,
get_cohort_by_name,
add_cohort,
......
......@@ -1462,7 +1462,7 @@ class DiscussionService(object):
from django_comment_client.forum.views import get_threads, make_course_settings
from django_comment_client.permissions import cached_has_permission
import django_comment_client.utils as utils
from course_groups.cohorts import (
from openedx.core.djangoapps.course_groups.cohorts import (
is_course_cohorted,
get_cohort_id,
get_cohorted_commentables,
......@@ -1480,7 +1480,7 @@ class DiscussionService(object):
user_cohort_id = get_cohort_id(user, course_id)
unsafethreads, query_params = get_threads(request, course_id)
threads = [utils.safe_content(thread, course_id) for thread in unsafethreads]
threads = [utils.prepare_content(thread, course_id) for thread in unsafethreads]
utils.add_courseware_context(threads, course)
flag_moderator = cached_has_permission(user, 'openclose_thread', course_id) or has_access(user, 'staff', course)
......
......@@ -384,7 +384,7 @@ def single_thread(request, course_key, discussion_id, thread_id):
'sort_preference': cc_user.default_sort_key,
'category_map': course_settings["category_map"],
'course_settings': _attr_safe_json(course_settings),
'cohorted_commentables': (get_cohorted_commentables(course_id))
'cohorted_commentables': (get_cohorted_commentables(course_key))
}
return render_to_response('discussion/index.html', context)
......@@ -419,7 +419,7 @@ def user_profile(request, course_key, user_id):
profiled_user = cc.User(id=user_id, course_id=course_key)
threads, page, num_pages = profiled_user.active_threads(query_params)
threads = _set_group_names(course_id, threads)
threads = _set_group_names(course_key, threads)
query_params['page'] = page
query_params['num_pages'] = num_pages
user_info = cc.User.from_django_user(request.user).to_dict()
......@@ -499,7 +499,7 @@ def followed_threads(request, course_key, user_id):
query_params['group_id'] = group_id
threads, page, num_pages = profiled_user.subscribed_threads(query_params)
threads = _set_group_names(course_id, threads)
threads = _set_group_names(course_key, threads)
query_params['page'] = page
query_params['num_pages'] = num_pages
user_info = cc.User.from_django_user(request.user).to_dict()
......
......@@ -1713,14 +1713,9 @@ if FEATURES.get('AUTH_USE_CAS'):
############# CORS headers for cross-domain requests #################
if FEATURES.get('ENABLE_CORS_HEADERS'):
INSTALLED_APPS += ('corsheaders', 'cors_csrf')
MIDDLEWARE_CLASSES = (
'corsheaders.middleware.CorsMiddleware',
'cors_csrf.middleware.CorsCSRFMiddleware',
) + MIDDLEWARE_CLASSES
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_WHITELIST = ('devstack.local', 'apros.devstack.local')
CORS_ORIGIN_REGEX_WHITELIST = ('^http?://(\w+\.)?devstack\.local$',)
CORS_ORIGIN_WHITELIST = ()
CORS_ORIGIN_ALLOW_ALL = False
###################### Registration ##################################
......
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