ahmedaljawahiry/django-admin-site-search

Search only working on the admin index page

tfeldmann opened this issue · 2 comments

Thank you for this project, it really comes in handy!

I think something might be wrong with how the search url is generated. My project is a bit different because it uses "/" as the path to the admin:

path("", admin.site.urls, name="home"),

So when I'm searching on the admin:index page the search url is: /search/?q=asd.
Now when I open the user groups it searches /auth/search/?q=asd and says "An unexpected error occured".

Is there a configuration option for the search url?

Happy to hear you're enjoying the project, and thanks for raising the issue!

Looks like the current approach for determining the search path has hit its limit! I anticipated we'd need to pass this explicitly.

This PR should address the issue. Though, the path is still set to search/, without an override. This may be an issue if anyone already has a page at search/ - I'll make a note to get this configurable.

Will look to get #14 merged and released asap

Changes above released in 0.4.0, along with an option for configuring the path (readme updated).

Closing this, but let me know if there's any issues!