Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit 8132cfa

Browse files
committed
We currently just support dx.
1 parent 6c9fbc6 commit 8132cfa

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/plone/app/angularjs/api/api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@ def __call__(self):
5959
'code': '404',
6060
'message': "No object found for path '%s'." % path,
6161
}
62-
try:
63-
text = obj.getText()
64-
except AttributeError:
62+
63+
# process rich text
64+
text = getattr(obj, 'text', None)
65+
if text is not None:
66+
text = text.output
67+
else:
6568
text = ''
69+
6670
return {
6771
'route': path,
6872
'id': obj.id,

src/plone/app/angularjs/tests/test_api_traversal.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from zope.interface import directlyProvides
77
from zope.component import getMultiAdapter
88

9+
from plone.app.textfield.value import RichTextValue
910
from plone.app.angularjs.interfaces import IAPIRequest
1011

1112
import unittest2 as unittest
@@ -69,6 +70,11 @@ def test_traversal_not_found(self):
6970

7071
def test_traversal_document(self):
7172
self.portal.invokeFactory('Document', 'doc1')
73+
self.portal.doc1.text = RichTextValue(
74+
u"Lorem ipsum.",
75+
'text/plain',
76+
'text/html'
77+
)
7278
self.request.set('path', 'doc1')
7379

7480
view = getMultiAdapter(
@@ -82,7 +88,7 @@ def test_traversal_document(self):
8288
u'route': u'/plone/doc1',
8389
u'title': u'',
8490
u'description': u'',
85-
u'text': u'',
91+
u'text': u'<p>Lorem ipsum.</p>',
8692
u'id': u'doc1'
8793
}
8894
)

0 commit comments

Comments
 (0)