Skip to content

Commit

Permalink
Removed get_user_model from module level
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel Obdam committed Nov 25, 2014
1 parent da3a887 commit c714c21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions persistent_messages/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import persistent_messages
from persistent_messages.constants import PERSISTENT_MESSAGE_LEVELS
from django.db import models
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.encoding import force_unicode
from django.contrib import messages
Expand All @@ -11,8 +12,8 @@
LEVEL_TAGS = utils.get_level_tags()

class Message(models.Model):
user = models.ForeignKey(get_user_model(), blank=True, null=True)
from_user = models.ForeignKey(get_user_model(), blank=True, null=True, related_name="from_user")
user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True)
from_user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, related_name="from_user")
subject = models.CharField(max_length=255, blank=True, default='')
message = models.TextField()
LEVEL_CHOICES = (
Expand Down Expand Up @@ -83,4 +84,4 @@ def _get_tags(self):
return u' '.join([label_tag, read_tag])
return read_tag
tags = property(_get_tags)


0 comments on commit c714c21

Please sign in to comment.