Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
54f62a85
Commit
54f62a85
authored
Jun 16, 2015
by
Ali Mohammad
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8224 from Stanford-Online/kluo/course-creation-after-deletion
Allow course creation after deletion at same URL
parents
fcc97a3f
760bda1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
cms/djangoapps/contentstore/tests/test_contentstore.py
+11
-0
common/lib/xmodule/xmodule/modulestore/mixed.py
+1
-1
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
54f62a85
...
...
@@ -1109,6 +1109,17 @@ class ContentStoreTest(ContentStoreTestCase):
self
.
assertFalse
(
instructor_role
.
has_user
(
self
.
user
))
self
.
assertEqual
(
len
(
instructor_role
.
users_with_role
()),
0
)
def
test_create_course_after_delete
(
self
):
"""
Test that course creation works after deleting a course with the same URL
"""
test_course_data
=
self
.
assert_created_course
()
course_id
=
_get_course_id
(
self
.
store
,
test_course_data
)
delete_course_and_groups
(
course_id
,
self
.
user
.
id
)
self
.
assert_created_course
()
def
test_create_course_duplicate_course
(
self
):
"""Test new course creation - error path"""
self
.
client
.
ajax_post
(
'/course/'
,
self
.
course_data
)
...
...
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
54f62a85
...
...
@@ -586,7 +586,7 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
"""
# first make sure an existing course doesn't already exist in the mapping
course_key
=
self
.
make_course_key
(
org
,
course
,
run
)
if
course_key
in
self
.
mappings
:
if
course_key
in
self
.
mappings
and
self
.
mappings
[
course_key
]
.
has_course
(
course_key
)
:
raise
DuplicateCourseError
(
course_key
,
course_key
)
# create the course
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment