Replaced u string literal prefixes with six.u() calls to make it compatible with Python 3.2

This commit is contained in:
Amr Hassan 2014-03-02 12:20:21 +02:00
parent 778f208cc1
commit c90ee0562a
2 changed files with 5 additions and 4 deletions

View file

@ -24,6 +24,7 @@ from axes.models import AccessLog
from axes.models import AccessAttempt
from axes.signals import user_locked_out
import axes
import six
# see if the user has overridden the failure limit
@ -85,7 +86,7 @@ def query2str(items):
kvs = []
for k, v in items:
if k != 'password':
kvs.append(u'%s=%s' % (k, v))
kvs.append(six.u('%s=%s') % (k, v))
return '\n'.join(kvs)

View file

@ -1,5 +1,5 @@
from django.db import models
import six
class CommonAccess(models.Model):
user_agent = models.CharField(
@ -59,7 +59,7 @@ class AccessAttempt(CommonAccess):
return self.failures_since_start
def __unicode__(self):
return u'Attempted Access: %s' % self.attempt_time
return six.u('Attempted Access: %s') % self.attempt_time
class AccessLog(CommonAccess):
@ -69,4 +69,4 @@ class AccessLog(CommonAccess):
)
def __unicode__(self):
return u'Access Log for %s @ %s' % (self.username, self.attempt_time)
return six.u('Access Log for %s @ %s') % (self.username, self.attempt_time)