Added commit_on_success_with_read_committed decorator to views
which raise IntegrityErrors. TNL-367
This commit is contained in:
@@ -17,6 +17,7 @@ from course_modes.models import CourseMode
|
||||
from courseware.access import has_access
|
||||
from student.models import CourseEnrollment
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from util.db import commit_on_success_with_read_committed
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
|
||||
@@ -121,6 +122,7 @@ class ChooseModeView(View):
|
||||
return render_to_response("course_modes/choose.html", context)
|
||||
|
||||
@method_decorator(login_required)
|
||||
@method_decorator(commit_on_success_with_read_committed)
|
||||
def post(self, request, course_id):
|
||||
"""Takes the form submission from the page and parses it.
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ import track.views
|
||||
|
||||
from dogapi import dog_stats_api
|
||||
|
||||
from util.db import commit_on_success_with_read_committed
|
||||
from util.json_request import JsonResponse
|
||||
from util.bad_request_rate_limiter import BadRequestRateLimiter
|
||||
|
||||
@@ -615,6 +616,7 @@ def try_change_enrollment(request):
|
||||
|
||||
|
||||
@require_POST
|
||||
@commit_on_success_with_read_committed
|
||||
def change_enrollment(request, auto_register=False, check_access=True):
|
||||
"""
|
||||
Modify the enrollment status for the logged-in user.
|
||||
|
||||
Reference in New Issue
Block a user