Skip to content

Commit

Permalink
Allow using User without _cls field
Browse files Browse the repository at this point in the history
  • Loading branch information
erezarnon committed Sep 20, 2016
1 parent daff222 commit 879c63a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions django_mongoengine/mongo_auth/models.py
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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}
]
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 879c63a

Please sign in to comment.