Saving custom user model with django-allauth

后端 未结 3 2118
长情又很酷
长情又很酷 2021-01-02 17:54

I have django custom user model MyUser with one extra field:

# models.py
from django.contrib.auth.models import AbstractUser

class MyUser(Abstr         


        
3条回答
  •  萌比男神i
    2021-01-02 18:40

    i think you should define fields property in class Meta in SignupForm and set list of fields that contains age, like this :

    class SignupForm(forms.Form):
    ...
       class Meta:
          model = MyUser
          fields = ['first_name', 'last_name', 'age']
    

    and if it's not worked, look at this

提交回复
热议问题