Skip to content

Commit

Permalink
Fix image link.
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto committed Mar 29, 2015
1 parent 8f27c9f commit adbf869
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/_json/newsitem.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"exclude_from_nav": "False",
"expires": "2499-12-31T00:00:00+02:00",
"icon": "++resource++plone.dexterity.item.gif",
"image": "http://localhost:55001/plone/newsitem/image.png",
"image": "http://localhost:55001/plone/newsitem/@@images/image",
"image_caption": "This is an image caption.",
"isPrincipiaFolderish": "0",
"language": "",
Expand Down
4 changes: 2 additions & 2 deletions src/plone/restapi/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def SerializeToJson(context):
result[title] = value
# Image
elif isinstance(value, NamedBlobImage):
result[title] = '{0}/{1}'.format(
result[title] = '{0}/@@images/{1}'.format(
context.absolute_url(),
value.filename
title
)
# File
elif isinstance(value, NamedBlobFile):
Expand Down
2 changes: 1 addition & 1 deletion src/plone/restapi/tests/test_adapter_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def test_image_adapter(self):
self.portal.imagedoc1.image_caption = u'This is an image caption.'

self.assertEqual(
u'http://nohost/plone/imagedoc1/image.png',
u'http://nohost/plone/imagedoc1/@@images/image',
json.loads(ISerializeToJson(self.portal.imagedoc1)).get('image')
)
2 changes: 1 addition & 1 deletion src/plone/restapi/tests/test_browser_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_news_item_traversal(self):
response.json()['image_caption']
)
self.assertEqual(
u'http://localhost:55001/plone/news1/image.png',
u'http://localhost:55001/plone/news1/@@images/image',
response.json()['image']
)

Expand Down

0 comments on commit adbf869

Please sign in to comment.