AA-131: Allow anonymous users through course home MFE

This commit is contained in:
Carla Duarte
2020-11-20 16:00:27 -05:00
parent b115dec7ae
commit 99163bdf2c
12 changed files with 122 additions and 91 deletions

View File

@@ -47,6 +47,7 @@ from common.djangoapps.student.models import (
)
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.search import path_to_location
from xmodule.x_module import PUBLIC_VIEW, STUDENT_VIEW
from .serializers import CourseInfoSerializer
from .utils import serialize_upgrade_info
@@ -483,7 +484,12 @@ class SequenceMetadata(DeveloperErrorViewMixin, APIView):
str(usage_key.course_key),
str(usage_key),
disable_staff_debug_info=True)
return Response(json.loads(sequence.handle_ajax('metadata', None)))
view = STUDENT_VIEW
if request.user.is_anonymous:
view = PUBLIC_VIEW
return Response(json.loads(sequence.handle_ajax('metadata', None, view=view)))
class Resume(DeveloperErrorViewMixin, APIView):