Skip to content

Extending mongoengine User model for SOCIAL_AUTH_USER_MODEL #70

@Diolor

Description

@Diolor

I need some help creating a custom User model, in order to extend it.

My models.py is :

from mongoengine.django.auth import User 

class User(User):
    """Extend Mongo Engine User model"""
    foo = ListField(default=[])

So I have updated the settings.py with:

MONGOENGINE_USER_DOCUMENT = 'apps.models.User'
AUTH_USER_MODEL =  'mongo_auth.MongoUser'
SOCIAL_AUTH_USER_MODEL =  'apps.models.User'

However on login I get:

ValidationError: ValidationError (UserSocialAuth:526fab8ac36b440b4a8f080b) (A ReferenceField only accepts DBRef or documents: ['user'])

I checked I saw that the 526fab8ac36b440b4a8f080b id is the user id in user_social_auth collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions