Skip to content

Commit

Permalink
Merge pull request #56 from sdelements/fix/add_unicode_to_password_ex…
Browse files Browse the repository at this point in the history
…piry

Add __unicode__ method to PasswordExpiry
  • Loading branch information
shawngustaw committed Mar 17, 2017
2 parents c9a877f + a4d7a78 commit e218ffc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions security/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class PasswordExpiry(models.Model):
security.RequirePasswordChangeMiddleware.
"""

class Meta(object):
verbose_name_plural = "PasswordExpiries"

# Not one-to-one because some users may never receive an expiry date.
user = models.ForeignKey(USER_MODEL, unique=True)

Expand All @@ -41,8 +44,8 @@ def never_expire(self):
self.password_expiry_date = None
self.save()

class Meta(object):
verbose_name_plural = "PasswordExpiries"
def __unicode__(self):
return u'Password Expiry: {0}'.format(self.user)


# http://www.w3.org/TR/CSP/#sample-violation-report
Expand Down Expand Up @@ -103,7 +106,7 @@ class CspReport(models.Model):
)

def __unicode__(self):
return 'CSP Report: {0} from {1}'.format(
return u'CSP Report: {0} from {1}'.format(
self.blocked_uri,
self.document_uri,
)

0 comments on commit e218ffc

Please sign in to comment.