Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
32063fe0
Commit
32063fe0
authored
10 years ago
by
Usman Khalid
Browse files
Options
Downloads
Patches
Plain Diff
Added commit_on_success_with_read_committed decorator to views
which raise IntegrityErrors. TNL-367
parent
ae095732
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/course_modes/views.py
+2
-0
2 additions, 0 deletions
common/djangoapps/course_modes/views.py
common/djangoapps/student/views.py
+2
-0
2 additions, 0 deletions
common/djangoapps/student/views.py
with
4 additions
and
0 deletions
common/djangoapps/course_modes/views.py
+
2
−
0
View file @
32063fe0
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
common/djangoapps/student/views.py
+
2
−
0
View file @
32063fe0
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment