Skip to content

Commit

Permalink
Modify InvitationAdmin to use autocomplete widget for inviter field
Browse files Browse the repository at this point in the history
Replace raw_id_fields with autocomplete_fields for the inviter field, as
that's more practical when searching for a user, although it may affect
performance of the form if there is a large number of users.

Fixes #259.
  • Loading branch information
JoGorska authored and Flimm committed Aug 13, 2024
1 parent da2e3b2 commit 378b2f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion invitations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@admin.register(Invitation)
class InvitationAdmin(admin.ModelAdmin):
list_display = ("email", "sent", "accepted")
raw_id_fields = ("inviter",)
autocomplete_fields = ["inviter"]

def get_form(self, request, obj=None, **kwargs):
if obj:
Expand Down

0 comments on commit 378b2f5

Please sign in to comment.