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

AuthTokenAdmin list_filter is causing performance problems (mostly timeouts) #28

Open
sunweiyang opened this issue Jun 17, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sunweiyang
Copy link

Our app has ~50k User objects and even more Client objects, and currently, because of AuthTokenAdmin's list_filter, our app times out every time we access the AuthToken list page in Django admin (because the filter lists every single one of these User and Client objects as possible filters). Can AuthTokenAdmin's list_filter be removed?

@sunweiyang sunweiyang changed the title AuthTokenAdmin list_filter is causing performance problems AuthTokenAdmin list_filter is causing performance problems (mostly timeouts) Jun 17, 2022
@eshaan7
Copy link
Owner

eshaan7 commented Jul 6, 2022

Hi.

You make a solid point and ideally it should not have been there but I don't know how soon I'll be able to ship a new release with this change. Meanwhile, you should easily be able to override the AuthTokenAdmin class and customize it as per your need, like so:

from durin.admin import AuthTokenAdmin
from durin.models import AuthToken

class CustomAuthTokenAdmin(AuthTokenAdmin):
    list_filter = []

# Unregister the default admin view for AuthToken
admin.site.unregister(AuthToken)
# Register our custom admin view for AuthToken
admin.site.register(AuthToken, CustomAuthTokenAdmin)

@eshaan7 eshaan7 added the bug Something isn't working label Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants