Properly update user foreign key to Django 1.6+

This commit is contained in:
Drew Hubl 2014-05-06 07:55:30 -06:00
parent fea25e9184
commit 1c4300000d

View file

@ -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,