mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-05-09 11:04:42 +00:00
Python 3 only - everything is unicode
This commit is contained in:
parent
f2a0449766
commit
6420a185d2
2 changed files with 7 additions and 7 deletions
|
|
@ -22,7 +22,7 @@ class TermsOfServiceManager(models.Manager):
|
|||
return self.get(active=True)
|
||||
except self.model.DoesNotExist:
|
||||
raise NoActiveTermsOfService(
|
||||
u'Please create an active Terms-of-Service'
|
||||
'Please create an active Terms-of-Service'
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ class TermsOfService(BaseModel):
|
|||
default=False,
|
||||
verbose_name=_('active'),
|
||||
help_text=_(
|
||||
u'Only one terms of service is allowed to be active'
|
||||
'Only one terms of service is allowed to be active'
|
||||
)
|
||||
)
|
||||
content = models.TextField(verbose_name=_('content'), blank=True)
|
||||
|
|
@ -43,7 +43,7 @@ class TermsOfService(BaseModel):
|
|||
verbose_name = _('Terms of Service')
|
||||
verbose_name_plural = _('Terms of Service')
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
active = 'inactive'
|
||||
if self.active:
|
||||
active = 'active'
|
||||
|
|
@ -61,7 +61,7 @@ class TermsOfService(BaseModel):
|
|||
.filter(active=True)\
|
||||
.exists():
|
||||
raise NoActiveTermsOfService(
|
||||
u'One of the terms of service must be marked active'
|
||||
'One of the terms of service must be marked active'
|
||||
)
|
||||
|
||||
super(TermsOfService, self).save(*args, **kwargs)
|
||||
|
|
@ -71,8 +71,8 @@ class UserAgreement(BaseModel):
|
|||
terms_of_service = models.ForeignKey(TermsOfService, related_name='terms', on_delete=models.CASCADE)
|
||||
user = models.ForeignKey(get_fk_user_model(), related_name='user_agreement', on_delete=models.CASCADE)
|
||||
|
||||
def __unicode__(self):
|
||||
return u'%s agreed to TOS: %s' % (self.user.username,
|
||||
def __str__(self):
|
||||
return '%s agreed to TOS: %s' % (self.user.username,
|
||||
unicode(self.terms_of_service))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ def check_tos(request, template_name='tos/tos_check.html',
|
|||
else:
|
||||
messages.error(
|
||||
request,
|
||||
_(u"You cannot login without agreeing to the terms of this site.")
|
||||
_("You cannot login without agreeing to the terms of this site.")
|
||||
)
|
||||
context = {
|
||||
'tos': tos,
|
||||
|
|
|
|||
Loading…
Reference in a new issue