diff --git a/djangoldp/views.py b/djangoldp/views.py index f93ceb8b4337dc6cf19ae1b0ea4249b960d28e50..3e5c62be8721d6542a163cabf68bee0fd60cbca2 100644 --- a/djangoldp/views.py +++ b/djangoldp/views.py @@ -1,6 +1,7 @@ from django.apps import apps from django.conf import settings from django.conf.urls import url, include +from django.contrib.auth import get_user_model from django.core.exceptions import FieldDoesNotExist from django.core.urlresolvers import get_resolver from django.db.utils import OperationalError, ProgrammingError @@ -119,7 +120,7 @@ class LDPViewSet(LDPViewSetGenerator): return type(LDPSerializer)(model_name + 'Serializer', (LDPSerializer,), {'Meta': meta_class}) def perform_create(self, serializer, **kwargs): - if hasattr(self.model._meta, 'auto_author') and isinstance(self.request.user, settings.AUTH_USER_MODEL): + if hasattr(self.model._meta, 'auto_author') and isinstance(self.request.user, get_user_model()): kwargs[self.model._meta.auto_author] = self.request.user serializer.save(**kwargs)