From 00d3dd1461a923ef9ab16da9f90b0848c2df21de Mon Sep 17 00:00:00 2001 From: Elias Fank Date: Wed, 6 Dec 2023 09:26:30 -0300 Subject: [PATCH] Fix url for multiple sites support Resolve #101 I'm also working with multiple sites and my solution was to use the name of the site according to the admin_site of the class. This way it could make the app more dynamic and without any negative effects. --- djangoql/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/djangoql/admin.py b/djangoql/admin.py index 41a73e5..8838e65 100644 --- a/djangoql/admin.py +++ b/djangoql/admin.py @@ -166,7 +166,8 @@ def get_urls(self): return custom_urls + super(DjangoQLSearchMixin, self).get_urls() def introspect(self, request): - suggestions_url = reverse('admin:%s_%s_djangoql_suggestions' % ( + suggestions_url = reverse('%s:%s_%s_djangoql_suggestions' % ( + self.admin_site.name, self.model._meta.app_label, self.model._meta.model_name, ))