Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate_field: accessing deprecated field NoneType.<unknown> #19

Open
hvdklauw opened this issue Jun 24, 2021 · 1 comment
Open

deprecate_field: accessing deprecated field NoneType.<unknown> #19

hvdklauw opened this issue Jun 24, 2021 · 1 comment

Comments

@hvdklauw
Copy link

We started used deprecate-fields and saw this warning in our logs.

Turns out django-fsm uses inspect.getmembers which in turn does a getattr(object, key) where the object is the class, not an instance.

Maybe simply catching the None value at the start would be enough.

@willplaehn
Copy link

This can also happen when you add a deprecated field to an admin.ModelAdmin.list_display

Workaround:

To find the problematic model, you can:

  1. put a breakpoint in django_deprecate_fields/deprecate_field.py DeprecatedField.__get__
  2. move up the call stack to django/contrib/adminchecks.py _check_list_display_item
  3. inspect obj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants