Reputation:
I'm trying to extend user but getting errors
settings.py
AUTH_USER_MODEL = 'bffcode.User'
models.py
from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
fb_userid = models.CharField(max_length=256)
objects =AbstractUser()
views.py
def fb_login(request):
users = User.objects.filter(fb_userid=fb_user_id)
Upvotes: 1
Views: 170
Reputation: 599956
You've set the objects
attribute of your User class to an instance of AbstractUser. It is supposed to be a Manager.
Unless you actually have a custom Manager subclass, it's best to leave this alone; you should delete that line.
Upvotes: 2