From 1d3405cb8c0637f2e7d95559255c88549b040ebf Mon Sep 17 00:00:00 2001 From: monodo Date: Tue, 28 May 2024 17:06:34 +0200 Subject: [PATCH] [YC-1206] fix error on ftsearch (#1004) * fix error on ftsearch * adress review comments * typo --- geocity/apps/submissions/admin.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/geocity/apps/submissions/admin.py b/geocity/apps/submissions/admin.py index a513674a9..d70b63fc1 100644 --- a/geocity/apps/submissions/admin.py +++ b/geocity/apps/submissions/admin.py @@ -239,7 +239,11 @@ class ComplementaryDocumentTypeAdmin(IntegratorFilterMixin, admin.ModelAdmin): ComplementaryDocumentTypeInline, ] form = ComplementaryDocumentTypeAdminForm - fields = ["name", "form", "integrator"] + fields = [ + "name", + "form", + "integrator", + ] def get_list_display(self, request): if request.user.is_superuser: @@ -258,29 +262,39 @@ def get_list_display(self, request): return list_display # Fields used in search_fields and list_filter - integrator_fields = [ + superuser_search_fields = [ + "name", + "form__name", + "integrator__name", + ] + integrator_search_fields = [ + "name", + "form__name", + ] + + superuser_list_search_fields = [ "name", "form", "integrator", - "form__administrative_entities", ] - user_fields = [ + + integrator_list_search_fields = [ "name", "form", ] def get_search_fields(self, request): if request.user.is_superuser: - search_fields = self.integrator_fields + search_fields = self.superuser_search_fields else: - search_fields = self.user_fields + search_fields = self.integrator_search_fields return search_fields def get_list_filter(self, request): if request.user.is_superuser: - list_filter = self.integrator_fields + list_filter = self.superuser_list_search_fields else: - list_filter = self.user_fields + list_filter = self.integrator_list_search_fields return list_filter # List types of documents