Commit 50e625e0 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! py2/py3: str.encode('hex') does not work in Python 3.

parent b5a975f4
......@@ -11,7 +11,7 @@ if value:
# concurrency between Credential Request and ERP5 Login object too
#
# XXX: hex encoded value may exceed 'tag' column length (255)...
if context.getPortalObject().portal_activities.countMessageWithTag('set_login_' + bytes2str(binascii.hexlify(str2bytes2(value)))):
if context.getPortalObject().portal_activities.countMessageWithTag('set_login_' + bytes2str(binascii.hexlify(str2bytes(value)))):
return False
def getRealContext():
......
......@@ -41,7 +41,7 @@ credential_request = module.newContent(
credential_request.setCategoryList(category_list)
# Same tag is used as in ERP5 Login._setReference, in order to protect against
# concurrency between Credential Request and Person object too
tag = 'set_login_%s' % bytes2str(binascii.hexlify(str2bytes2(reference)))
tag = 'set_login_%s' % bytes2str(binascii.hexlify(str2bytes(reference)))
credential_request.reindexObject(activate_kw={'tag': tag})
#We attach the current user to the credential request if not anonymous
......
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