openedx.features.learner_profile.views package#
Submodules#
openedx.features.learner_profile.views.learner_achievements module#
Views to render a learner’s achievements.
- class openedx.features.learner_profile.views.learner_achievements.LearnerAchievementsFragmentView(**kwargs)#
Bases:
EdxFragmentViewA fragment to render a learner’s achievements.
- render_to_fragment(request, username=None, own_profile=False, **kwargs)#
Renders the current learner’s achievements.
openedx.features.learner_profile.views.learner_profile module#
Views for a student’s profile information.
- openedx.features.learner_profile.views.learner_profile.learner_profile(request, username)#
Render the profile page for the specified username.
- Parameters:
request (HttpRequest) –
username (str) – username of user whose profile is requested.
- Returns:
200 if the page was sent successfully HttpResponse: 302 if not logged in (redirect to login page) HttpResponse: 405 if using an unsupported HTTP method
- Return type:
HttpResponse
- Raises:
Http404 – 404 if the specified user is not authorized or does not exist
- Example usage:
GET /account/profile
- openedx.features.learner_profile.views.learner_profile.learner_profile_context(request, profile_username, user_is_staff)#
Context for the learner profile page.
- Parameters:
- Returns:
dict
- Raises:
ObjectDoesNotExist – the specified profile_username does not exist.