--- 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)