Commit 6dad47e9 authored by Julien Muchembled's avatar Julien Muchembled

Small optimizations

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32380 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 398ac1af
......@@ -611,15 +611,9 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
# staff. The only real solution is to use a special
# permission (ex. AccessPrivateInformation) for those
# properties which are sensitive.
if not kwargs.has_key('args'):
kwargs['args'] = args
if kwargs.has_key('key_prefix'):
key_prefix = kwargs['key_prefix']
del(kwargs['key_prefix'])
else:
key_prefix = None
form = self
obj = getattr(form, 'aq_parent', None)
kwargs.setdefault('args', args)
key_prefix = kwargs.pop('key_prefix', None)
obj = getattr(self, 'aq_parent', None)
if obj is not None:
container = obj.aq_inner.aq_parent
if not _checkPermission(Permissions.View, obj):
......
......@@ -2342,15 +2342,13 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
html += u' <span class="error">%s</span>' % error_message
else:
# If not editable, show a static text with a link, if enabled.
processed_value = cgi.escape(processed_value)
if url is None:
html = processed_value
else:
html = cgi.escape(processed_value)
if url is not None:
# JPS-XXX - I think we should not display a URL for objects
# which do not have the View permission
if type(url) is str:
if instance(url, str):
url = unicode(url, encoding)
html = u'<a href="%s">%s</a>' % (url, processed_value)
html = u'<a href="%s">%s</a>' % (url, html)
html_list.append((html, original_value, error, editable_field, url))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment