mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-05-15 08:33:09 +00:00
Generic user model to recipient foreign key
This commit is contained in:
parent
a73c01f167
commit
74313bc2f1
1 changed files with 1 additions and 2 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue