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): ...@@ -611,15 +611,9 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
# staff. The only real solution is to use a special # staff. The only real solution is to use a special
# permission (ex. AccessPrivateInformation) for those # permission (ex. AccessPrivateInformation) for those
# properties which are sensitive. # properties which are sensitive.
if not kwargs.has_key('args'): kwargs.setdefault('args', args)
kwargs['args'] = args key_prefix = kwargs.pop('key_prefix', None)
if kwargs.has_key('key_prefix'): obj = getattr(self, 'aq_parent', None)
key_prefix = kwargs['key_prefix']
del(kwargs['key_prefix'])
else:
key_prefix = None
form = self
obj = getattr(form, 'aq_parent', None)
if obj is not None: if obj is not None:
container = obj.aq_inner.aq_parent container = obj.aq_inner.aq_parent
if not _checkPermission(Permissions.View, obj): if not _checkPermission(Permissions.View, obj):
......
...@@ -2342,15 +2342,13 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine): ...@@ -2342,15 +2342,13 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
html += u' <span class="error">%s</span>' % error_message html += u' <span class="error">%s</span>' % error_message
else: else:
# If not editable, show a static text with a link, if enabled. # If not editable, show a static text with a link, if enabled.
processed_value = cgi.escape(processed_value) html = cgi.escape(processed_value)
if url is None: if url is not None:
html = processed_value
else:
# JPS-XXX - I think we should not display a URL for objects # JPS-XXX - I think we should not display a URL for objects
# which do not have the View permission # which do not have the View permission
if type(url) is str: if instance(url, str):
url = unicode(url, encoding) 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)) 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