diff --git a/django_mongoengine/mongo_auth/models.py b/django_mongoengine/mongo_auth/models.py index 0a0d89f..264254e 100644 --- a/django_mongoengine/mongo_auth/models.py +++ b/django_mongoengine/mongo_auth/models.py @@ -169,7 +169,7 @@ def __unicode__(self): return self.name -class User(BaseUser, document.Document): +class AbstractUser(BaseUser, document.Document): """A User document that aims to mirror most of the API specified by Django at http://docs.djangoproject.com/en/dev/topics/auth/#users """ @@ -216,7 +216,7 @@ class User(BaseUser, document.Document): REQUIRED_FIELDS = ['email'] meta = { - 'allow_inheritance': True, + 'abstract': True, 'indexes': [ {'fields': ['username'], 'unique': True, 'sparse': True} ] @@ -347,6 +347,9 @@ def get_profile(self): return self._profile_cache +class User(AbstractUser): + meta = {'allow_inheritance': True} + class MongoUser(BaseUser, models.Model): """" Dummy user model for Django.