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
ce6c9383
Unverified
Commit
ce6c9383
authored
4 years ago
by
Calen Pennington
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23958 from cpennington/fix-case-collision-course-keys
Fix case collision course keys
parents
6a23e6f6
bf16155c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/content/course_overviews/models.py
+10
-1
10 additions, 1 deletion
openedx/core/djangoapps/content/course_overviews/models.py
with
10 additions
and
1 deletion
openedx/core/djangoapps/content/course_overviews/models.py
+
10
−
1
View file @
ce6c9383
...
...
@@ -40,6 +40,10 @@ from xmodule.tabs import CourseTab
log
=
logging
.
getLogger
(
__name__
)
class
CourseOverviewCaseMismatchException
(
Exception
):
pass
@python_2_unicode_compatible
class
CourseOverview
(
TimeStampedModel
):
"""
...
...
@@ -167,6 +171,11 @@ class CourseOverview(TimeStampedModel):
if
course_overview
.
exists
():
log
.
info
(
u
'
Updating course overview for %s.
'
,
six
.
text_type
(
course
.
id
))
course_overview
=
course_overview
.
first
()
# MySQL ignores casing, but CourseKey doesn't. To prevent multiple
# courses with different cased keys from overriding each other, we'll
# check for equality here in python.
if
course_overview
.
id
!=
course
.
id
:
raise
CourseOverviewCaseMismatchException
(
course_overview
.
id
,
course
.
id
)
else
:
log
.
info
(
u
'
Creating course overview for %s.
'
,
six
.
text_type
(
course
.
id
))
course_overview
=
cls
()
...
...
@@ -248,8 +257,8 @@ class CourseOverview(TimeStampedModel):
with
store
.
bulk_operations
(
course_id
):
course
=
store
.
get_course
(
course_id
)
if
isinstance
(
course
,
CourseDescriptor
):
course_overview
=
cls
.
_create_or_update
(
course
)
try
:
course_overview
=
cls
.
_create_or_update
(
course
)
with
transaction
.
atomic
():
course_overview
.
save
()
# Remove and recreate all the course tabs
...
...
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