Skip to content

Commit

Permalink
Use settings.AUTH_USER_MODEL instead of User directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
bunchesofdonald committed Aug 20, 2015
1 parent 0d6390e commit 16c3262
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions hermes/migrations/0004_auto_20150819_2229.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('hermes', '0003_post_is_published'),
]

operations = [
migrations.AlterField(
model_name='post',
name='is_published',
field=models.BooleanField(default=False),
preserve_default=True,
),
]
4 changes: 2 additions & 2 deletions hermes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
except:
pass # Must be python 3

from django.contrib.auth.models import User
from django.conf import settings as django_settings
from django.db import models
from django.utils.text import Truncator, slugify
from django.utils.translation import ugettext as _
Expand Down Expand Up @@ -162,7 +162,7 @@ class Post(TimestampedModel):
body = models.TextField(_('body'))

category = models.ForeignKey(Category)
author = models.ForeignKey(User)
author = models.ForeignKey(django_settings.AUTH_USER_MODEL)

objects = PostManager()

Expand Down

0 comments on commit 16c3262

Please sign in to comment.