mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-03-16 20:10:24 +00:00
Properly update user foreign key to Django 1.6+
This commit is contained in:
parent
fea25e9184
commit
1c4300000d
1 changed files with 1 additions and 3 deletions
|
|
@ -1,9 +1,7 @@
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
class NoActiveTermsOfService(ValidationError):
|
||||
pass
|
||||
|
|
@ -60,7 +58,7 @@ class TermsOfService(BaseModel):
|
|||
|
||||
class UserAgreement(BaseModel):
|
||||
terms_of_service = models.ForeignKey(TermsOfService, related_name='terms')
|
||||
user = models.ForeignKey(User, related_name='user_agreement')
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='user_agreement')
|
||||
|
||||
def __unicode__(self):
|
||||
return u'%s agreed to TOS: %s' % (self.user.username,
|
||||
|
|
|
|||
Loading…
Reference in a new issue