Merge pull request #69 from amrhassan/master

Replaced u string literal prefixes with six.u() calls
This commit is contained in:
Camilo Nova 2014-04-09 07:15:14 -05:00
commit 5cc1dd2215
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
from django.utils 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
from django.utils 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)