0
votes

Making the User.is_active flag a python @property instead of a read database field results in the following error:

django.core.exceptions.FieldError: Unknown field(s) (is_active) specified for User
class User(AbstractBaseUser, PermissionsMixin):
    @property
    def is_active(self):
        return ....

This is because wagtail.users.forms.UserEditForm included "is_active" in the fields:

class UserEditForm(UserForm):
    class Meta:
        model = User
        fields = {User.USERNAME_FIELD, "is_active"} | standard_fields | custom_fields

This error occurs as long "wagtail.users" is included in settings.INSTALLED_APPS, even when overriding the default forms as described in the documentation.

WAGTAIL_USER_EDIT_FORM = 'users.forms.CustomUserEditForm'
WAGTAIL_USER_CREATION_FORM = 'users.forms.CustomUserCreationForm'

I tried to disable the wagtail user management entirely, but this does not seem to be possible.
https://github.com/wagtail/wagtail/issues/3657

Any ideas how to make this work?