diff -r df44d7163582 -r e3994fcc21c3 entity.py --- a/entity.py Tue Sep 21 16:35:37 2010 +0200 +++ b/entity.py Thu Sep 23 23:28:58 2010 +0200 @@ -393,12 +393,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 - if 'base-url' not in kwargs and \ + 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)