Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
44c4418d
Commit
44c4418d
authored
Oct 26, 2017
by
Simon Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the bug left in the course run publish module
parent
f382f0ad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
course_discovery/apps/course_metadata/publishers.py
+1
-1
course_discovery/apps/course_metadata/tests/test_publishers.py
+9
-0
No files found.
course_discovery/apps/course_metadata/publishers.py
View file @
44c4418d
...
@@ -288,7 +288,7 @@ class BaseMarketingSitePublisher:
...
@@ -288,7 +288,7 @@ class BaseMarketingSitePublisher:
if
new_alias
!=
previous_alias
or
not
new_alias_delete_path
:
if
new_alias
!=
previous_alias
or
not
new_alias_delete_path
:
# Delete old alias before saving the new one.
# Delete old alias before saving the new one.
if
previous_obj
and
previous_obj
.
marketing_slug
!=
obj
.
marketing_slug
:
if
previous_obj
and
self
.
get_marketing_slug
(
previous_obj
)
!=
self
.
get_marketing_slug
(
obj
)
:
self
.
get_and_delete_alias
(
self
.
get_marketing_slug
(
previous_obj
))
self
.
get_and_delete_alias
(
self
.
get_marketing_slug
(
previous_obj
))
headers
=
{
headers
=
{
...
...
course_discovery/apps/course_metadata/tests/test_publishers.py
View file @
44c4418d
...
@@ -329,6 +329,15 @@ class CourseRunMarketingSitePublisherTests(MarketingSitePublisherTestMixin):
...
@@ -329,6 +329,15 @@ class CourseRunMarketingSitePublisherTests(MarketingSitePublisherTestMixin):
responses
.
reset
()
responses
.
reset
()
# A previous object is provided, but the marketing slug hasn't changed.
# Neither alias creation nor alias deletion should occur.
self
.
mock_api_client
()
self
.
mock_get_delete_form
(
self
.
obj
.
slug
)
self
.
publisher
.
update_node_alias
(
self
.
obj
,
self
.
node_id
,
self
.
obj
)
responses
.
reset
()
# In this case, similate the fact that alias form retrival returned error
# In this case, similate the fact that alias form retrival returned error
# FormRetrievalError should be raised
# FormRetrievalError should be raised
self
.
mock_api_client
()
self
.
mock_api_client
()
...
...
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