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 c410a8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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,7 +12,7 @@
LEVEL_TAGS = utils.get_level_tags()

class Message(models.Model):
user = models.ForeignKey(get_user_model(), blank=True, null=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True)
from_user = models.ForeignKey(get_user_model(), blank=True, null=True, related_name="from_user")
subject = models.CharField(max_length=255, blank=True, default='')
message = models.TextField()
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 c410a8d

Please sign in to comment.