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

Fix Pylint issues #37

Closed
wants to merge 1 commit into from
Closed

Fix Pylint issues #37

wants to merge 1 commit into from

Conversation

driverpt
Copy link

@driverpt driverpt commented May 31, 2019

ERRORS:
<class 'rest_framework_api_key.admin.APIKeyAdmin'>: (admin.E108) The value of 'list_display[4]' refers to 'has_expired_func', which is not a callable, an attribute of 'APIKeyAdmin', or an attribute or method on 'rest_framework_api_key.APIKey'.

@florimondmanca
Copy link
Owner

Hi,

Thanks for taking the time to open this PR. This field is actually required and dynamically added by the @.djangoproperty decorator. It is a work around the fact that the admin requires a reference to the property’s getter function to properly display Booleans as red/green icons.

To fix the Pylint issue, we can add a type annotation on the model instead. Can you try this out?

@florimondmanca
Copy link
Owner

@driverpt I didn't realize this was a system check error. This has been reported in #38 and a fix should be released soon. In the meantime we can see #38 for a hot fix. I'll close this since removing the field is a hot fix too, but it won't actually solve the problem. Stay tuned for a patch. Thanks!

@driverpt driverpt deleted the patch-1 branch June 3, 2019 13:43
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

Successfully merging this pull request may close these issues.

2 participants