Commit 24236c47 authored by Jérome Perrin's avatar Jérome Perrin

administration: py3

parent cf36b636
...@@ -3,7 +3,9 @@ security_uid_field_list = [x + ("_" if x != "" else "") + "security_uid" for x i ...@@ -3,7 +3,9 @@ security_uid_field_list = [x + ("_" if x != "" else "") + "security_uid" for x i
security_uid_set_list = [] security_uid_set_list = []
for security_uid_field in security_uid_field_list: for security_uid_field in security_uid_field_list:
security_uid_set_list.append({getattr(x, security_uid_field) for x in context.z_get_referenced_security_uid_set_for(security_uid_field=security_uid_field)}) security_uid_set_list.append({getattr(x, security_uid_field) for x in context.z_get_referenced_security_uid_set_for(security_uid_field=security_uid_field)})
security_uid_set = reduce(lambda p, v: p.union(v), security_uid_set_list) security_uid_set = set()
for s in security_uid_set_list:
security_uid_set = security_uid_set.union(s)
filtered_set = context.Base_filterSecurityUidDict( filtered_set = context.Base_filterSecurityUidDict(
portal.portal_catalog.getSQLCatalog(catalog_id).security_uid_dict, portal.portal_catalog.getSQLCatalog(catalog_id).security_uid_dict,
security_uid_set security_uid_set
......
...@@ -19,12 +19,12 @@ def getSkinHash(skin, skin_container): ...@@ -19,12 +19,12 @@ def getSkinHash(skin, skin_container):
elif skin.meta_type in ('ERP5 Form', ): elif skin.meta_type in ('ERP5 Form', ):
try: try:
content = skin.formXML() content = skin.formXML()
if isinstance(content, unicode): if not isinstance(content, bytes):
content = content.encode('utf8', 'repr') content = content.encode('utf8', 'repr')
except AttributeError as e: except AttributeError as e:
# This can happen with dead proxy fields. # This can happen with dead proxy fields.
content = "broken form %s" % e content = "broken form %s" % e
content = 'ignore' content = b'ignore'
m = hashlib.md5() m = hashlib.md5()
m.update(content) m.update(content)
content_hash = m.hexdigest() content_hash = m.hexdigest()
......
...@@ -47,4 +47,4 @@ else: ...@@ -47,4 +47,4 @@ else:
response.setHeader('content-type', content_type) response.setHeader('content-type', content_type)
response.setHeader('content-disposition', 'attachment; filename="' + filename + '"') response.setHeader('content-disposition', 'attachment; filename="' + filename + '"')
response.write(data) response.write(data)
raise Exception('profiling') raise RuntimeError('profiling')
\ No newline at end of file
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