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
c41456c5
Commit
c41456c5
authored
Jan 06, 2017
by
Matthew Piatetsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix publishing of programs to marketing site
ECOM-6765
parent
7b0ac593
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
course_discovery/apps/course_metadata/publishers.py
+3
-2
course_discovery/apps/course_metadata/tests/mixins.py
+7
-7
No files found.
course_discovery/apps/course_metadata/publishers.py
View file @
c41456c5
...
...
@@ -117,7 +117,7 @@ class MarketingSitePublisher(object):
def
_get_node_data
(
self
,
program
,
user_id
):
return
{
'type'
:
str
(
program
.
type
)
.
lower
(),
'type'
:
str
(
program
.
type
)
.
lower
()
.
replace
(
' '
,
'_'
)
,
'title'
:
program
.
title
,
'field_uuid'
:
str
(
program
.
uuid
),
'uuid'
:
str
(
program
.
uuid
),
...
...
@@ -132,7 +132,8 @@ class MarketingSitePublisher(object):
response
=
api_client
.
api_session
.
get
(
node_url
)
if
response
.
status_code
==
200
:
list_item
=
response
.
json
()
.
get
(
'list'
)
return
list_item
[
0
][
'nid'
]
if
list_item
:
return
list_item
[
0
][
'nid'
]
def
_edit_node
(
self
,
api_client
,
node_id
,
node_data
):
# Drupal does not allow us to update the UUID field on node update
...
...
course_discovery/apps/course_metadata/tests/mixins.py
View file @
c41456c5
...
...
@@ -101,14 +101,14 @@ class MarketingSitePublisherTestMixin(MarketingSiteAPIClientTestMixin):
def
mock_node_retrieval
(
self
,
program_uuid
,
exists
=
True
):
data
=
{}
status
=
404
status
=
200
data
=
{
'list'
:
[]
}
if
exists
:
data
=
{
'list'
:
[{
'nid'
:
self
.
node_id
}]
}
status
=
200
data
[
'list'
]
=
[{
'nid'
:
self
.
node_id
}]
responses
.
add
(
responses
.
GET
,
...
...
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