Skip to content

Commit

Permalink
🐛(backend) do not list all enrollments in admin order view
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kernicPanel authored and jbpenrath committed Oct 7, 2024
1 parent 2bbec06 commit 07e01cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/joanie/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 07e01cf

Please sign in to comment.