Commit 18e301d0 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

CMFActivity, ERP5Type: prevent some "Expected Text" warnings from transaction

parent 12370ec1
...@@ -327,7 +327,9 @@ class Message(BaseMessage): ...@@ -327,7 +327,9 @@ class Message(BaseMessage):
user = user.__of__(user_folder) user = user.__of__(user_folder)
newSecurityManager(None, user) newSecurityManager(None, user)
if annotate_transaction: if annotate_transaction:
transaction.get().setUser(user_name, '/'.join(user_folder.getPhysicalPath())) if six.PY2:
user_name = user_name.decode('utf-8')
transaction.get().setUser(user_name, u'/'.join(user_folder.getPhysicalPath()))
else : else :
LOG("CMFActivity", WARNING, LOG("CMFActivity", WARNING,
"Unable to find user %r in the portal" % user_name) "Unable to find user %r in the portal" % user_name)
......
...@@ -2634,7 +2634,7 @@ def initialize(self): ...@@ -2634,7 +2634,7 @@ def initialize(self):
manage_addERP5Site(app.__of__(RequestContainer(REQUEST=REQUEST)), manage_addERP5Site(app.__of__(RequestContainer(REQUEST=REQUEST)),
**{k: kw.get(k, v) for k, v in six.iteritems(default_kw) **{k: kw.get(k, v) for k, v in six.iteritems(default_kw)
if isinstance(v, str)}) if isinstance(v, str)})
transaction.get().note('Created ' + meta_type) transaction.get().note(u'Created ' + meta_type)
transaction.commit() transaction.commit()
break break
except OperationalError as e: except OperationalError as e:
......
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