From 07e01cf67cd4c002f1b464405bd541bcb102b709 Mon Sep 17 00:00:00 2001 From: Nicolas Clerc Date: Wed, 11 Sep 2024 16:09:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(backend)=20do=20not=20list=20all?= =?UTF-8?q?=20enrollments=20in=20admin=20order=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As we have a very large amount of enrollments in our staging and production database, displaying all of them in a select box breaks the admin order page. Using an autocomplete field prevent this. --- src/backend/joanie/core/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/joanie/core/admin.py b/src/backend/joanie/core/admin.py index 7324f4c89..eeacbf49a 100644 --- a/src/backend/joanie/core/admin.py +++ b/src/backend/joanie/core/admin.py @@ -576,7 +576,7 @@ class OrderAdmin(DjangoObjectActions, admin.ModelAdmin): """Admin class for the Order model""" actions = (ACTION_NAME_CANCEL, ACTION_NAME_GENERATE_CERTIFICATES) - autocomplete_fields = ["course", "organization", "owner", "product"] + autocomplete_fields = ["course", "enrollment", "organization", "owner", "product"] change_actions = (ACTION_NAME_GENERATE_CERTIFICATES,) list_display = ("id", "organization", "owner", "product", "state") list_filter = [OwnerFilter, OrganizationFilter, ProductFilter, "state"]