entity.py
branchstable
changeset 6317 0d4dd5f6f05c
parent 6307 c07763c59fcb
child 6333 e3994fcc21c3
child 6419 6aa0bb1c42e2
--- a/entity.py	Thu Sep 23 10:47:54 2010 +0200
+++ b/entity.py	Thu Sep 23 10:48:43 2010 +0200
@@ -492,12 +492,13 @@
         # in linksearch mode, we don't want external urls else selecting
         # the object for use in the relation is tricky
         # XXX search_state is web specific
+        use_ext_id = False
         if 'base_url' not in kwargs and \
                getattr(self._cw, 'search_state', ('normal',))[0] == 'normal':
-            kwargs['base_url'] = self.cw_metainformation()['source'].get('base-url')
-            use_ext_id = bool(kwargs['base_url'])
-        else:
-            use_ext_id = False
+            baseurl = self.cw_metainformation()['source'].get('base-url')
+            if baseurl:
+                kwargs['base_url'] = baseurl
+                use_ext_id = True
         if method in (None, 'view'):
             try:
                 kwargs['_restpath'] = self.rest_path(use_ext_id)