Skip to content

Commit

Permalink
Make sure username is never None since transaction only accepts unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer authored and hannosch committed Feb 20, 2017
1 parent 3f52f2a commit a35b29b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ZPublisher/utils.py
Expand Up @@ -61,7 +61,9 @@ def recordMetaData(object, request):
auth_path = request.get('AUTHENTICATION_PATH')
else:
auth_path = '/'.join(auth_folder.getPhysicalPath()[1:-1])
T.setUser(safe_unicode(auth_user.getId()), safe_unicode(auth_path))
user_id = auth_user.getId()
user_id = safe_unicode(user_id) if user_id else u'None'
T.setUser(user_id, safe_unicode(auth_path))


def safe_unicode(value, encoding='utf-8'):
Expand Down

0 comments on commit a35b29b

Please sign in to comment.