Skip to content

Commit 1d7c4e9

Browse files
committed
Handle empty Link for transitive property
.. in REST API: If we request a transitive property in parameters (e.g. author.username) and the Link is empty (None), we now return a username of None and do not fail with a 404.
1 parent 19b09ed commit 1d7c4e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

roundup/rest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,12 @@ def format_item(self, node, item_id, props=None, verbose=1):
627627
cl = self.db.getclass(cn)
628628
nd = cl.getnode(id)
629629
id = v = getattr(nd, p)
630+
# Handle transitive properties where something on
631+
# the road is None (empty Link property)
632+
if id is None :
633+
prop = None
634+
ok = True
635+
break
630636
prop = cl.getprops(protected=True)[p]
631637
cn = getattr(prop, 'classname', None)
632638
else:

0 commit comments

Comments
 (0)