diff --git a/lms/djangoapps/course_api/blocks/views.py b/lms/djangoapps/course_api/blocks/views.py index 7d7ed629fbecf98e0d7649ed2f32502e85de840a..54ae768383490779ad714a0a8d62cdc91886bfcd 100644 --- a/lms/djangoapps/course_api/blocks/views.py +++ b/lms/djangoapps/course_api/blocks/views.py @@ -5,7 +5,9 @@ CourseBlocks API views import six from django.core.exceptions import ValidationError +from django.db import transaction from django.http import Http404 +from django.utils.decorators import method_decorator from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from rest_framework.generics import ListAPIView @@ -21,6 +23,7 @@ from .forms import BlockListGetForm @view_auth_classes() +@method_decorator(transaction.non_atomic_requests, name='dispatch') class BlocksView(DeveloperErrorViewMixin, ListAPIView): """ **Use Case** diff --git a/openedx/features/course_experience/views/course_dates.py b/openedx/features/course_experience/views/course_dates.py index 3fc0ac270c94a5aa82313713eb810d304afa1426..a87f14be3f3b9bbe58e4253934d16e2eff5a1f78 100644 --- a/openedx/features/course_experience/views/course_dates.py +++ b/openedx/features/course_experience/views/course_dates.py @@ -3,9 +3,11 @@ Fragment for rendering the course dates sidebar. """ +from django.db import transaction from django.http import Http404 from django.template.loader import render_to_string from django.urls import reverse +from django.utils.decorators import method_decorator from django.utils.translation import get_language_bidi from opaque_keys.edx.keys import CourseKey from web_fragments.fragment import Fragment @@ -47,6 +49,7 @@ class CourseDatesFragmentView(EdxFragmentView): return dates_fragment +@method_decorator(transaction.non_atomic_requests, name='dispatch') class CourseDatesFragmentMobileView(CourseDatesFragmentView): """ A course dates fragment to show dates on mobile apps.