Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get User model for cookiecutter-django #555

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions zinnia/models/author.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Author model for Zinnia"""
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models
from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
Expand All @@ -13,8 +14,9 @@ def safe_get_user_model():
"""
Safe loading of the User model, customized or not.
"""
user_app, user_model = settings.AUTH_USER_MODEL.split('.')
return apps.get_registered_model(user_app, user_model)
# user_app, user_model = settings.AUTH_USER_MODEL.split('.')
# return apps.get_registered_model(user_app, user_model)
return get_user_model()


class AuthorPublishedManager(models.Model):
Expand Down