Generic user model to recipient foreign key

This commit is contained in:
Sandro Rodrigues 2013-12-12 00:53:31 +00:00
parent a73c01f167
commit 74313bc2f1

View file

@ -1,6 +1,5 @@
import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
@ -84,7 +83,7 @@ class Notification(models.Model):
LEVELS = Choices('success', 'info', 'warning', 'error')
level = models.CharField(choices=LEVELS, default='info', max_length=20)
recipient = models.ForeignKey(User, blank=False, related_name='notifications')
recipient = models.ForeignKey(settings.AUTH_USER_MODEL, blank=False, related_name='notifications')
unread = models.BooleanField(default=True, blank=False)
actor_content_type = models.ForeignKey(ContentType, related_name='notify_actor')