logger, six.string_types + six.integer_types (#36515)
This commit is contained in:
parent
6d8c2ffb14
commit
e4333e6719
|
@ -17,6 +17,8 @@
|
|||
import logging
|
||||
import os
|
||||
|
||||
from django.utils import six
|
||||
|
||||
from quixote import get_publisher, get_session, get_request
|
||||
from quixote.logger import DefaultLogger
|
||||
|
||||
|
@ -68,7 +70,7 @@ class Formatter(logging.Formatter):
|
|||
|
||||
user = request.user
|
||||
if user:
|
||||
if type(user) in (str, int, unicode):
|
||||
if isinstance(user, six.string_types + six.integer_types):
|
||||
user_id = user
|
||||
else:
|
||||
user_id = user.id
|
||||
|
|
Loading…
Reference in New Issue