Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
7c2fec21
Commit
7c2fec21
authored
9 years ago
by
Eric Fischer
Browse files
Options
Downloads
Plain Diff
Merge pull request #10771 from edx/efischer/revert-rc-fix
Revert "Fixing CohortMembership and ATOMIC_REQUESTS issue"
parents
07c6b7cc
9e902264
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/course_groups/models.py
+0
-5
0 additions, 5 deletions
openedx/core/djangoapps/course_groups/models.py
with
0 additions
and
5 deletions
openedx/core/djangoapps/course_groups/models.py
+
0
−
5
View file @
7c2fec21
...
...
@@ -98,12 +98,9 @@ class CohortMembership(models.Model):
success
=
False
for
__
in
range
(
max_retries
):
# This block will transactionally commit updates to CohortMembership and underlying course_user_groups.
with
transaction
.
atomic
():
try
:
# This block is atomic in order to make CohortMembership creation a small operation.
# It will commit the creation of the new CohortMembership, if needed.
with
transaction
.
atomic
():
saved_membership
,
created
=
CohortMembership
.
objects
.
select_for_update
().
get_or_create
(
user__id
=
self
.
user
.
id
,
...
...
@@ -126,11 +123,9 @@ class CohortMembership(models.Model):
self
.
previous_cohort_name
=
saved_membership
.
course_user_group
.
name
self
.
previous_cohort_id
=
saved_membership
.
course_user_group
.
id
self
.
previous_cohort
.
users
.
remove
(
self
.
user
)
self
.
previous_cohort
.
save
()
saved_membership
.
course_user_group
=
self
.
course_user_group
self
.
course_user_group
.
users
.
add
(
self
.
user
)
self
.
course_user_group
.
save
()
super
(
CohortMembership
,
saved_membership
).
save
(
update_fields
=
[
'
course_user_group
'
])
...
...
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