Commit 43834839 by John Eskew

Quality fixes and unicode strings for logs.

parent 81ad1dc6
......@@ -110,8 +110,8 @@ class OpaqueKeyField(models.CharField):
if value.endswith('\n'):
# An opaque key with a trailing newline has leaked into the DB.
# Log and strip the value.
log.warning('{}:{}:{}:to_python: Invalid key: {}. Removing trailing newline.'.format(
self.model._meta.db_table,
log.warning(u'{}:{}:{}:to_python: Invalid key: {}. Removing trailing newline.'.format(
self.model._meta.db_table, # pylint: disable=protected-access
self.name,
self.KEY_CLASS.__name__,
repr(value)
......@@ -140,8 +140,8 @@ class OpaqueKeyField(models.CharField):
if serialized_key.endswith('\n'):
# An opaque key object serialized to a string with a trailing newline.
# Log the value - but do not modify it.
log.warning('{}:{}:{}:get_prep_value: Invalid key: {}.'.format(
self.model._meta.db_table,
log.warning(u'{}:{}:{}:get_prep_value: Invalid key: {}.'.format(
self.model._meta.db_table, # pylint: disable=protected-access
self.name,
self.KEY_CLASS.__name__,
repr(serialized_key)
......
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