Skip to content

Commit

Permalink
Update AccountAdapter to use default list filter
Browse files Browse the repository at this point in the history
Also add crispy_bootstrap5 to the installed apps, which is required
to use the crispy form for the list filtering.
  • Loading branch information
amstilp committed Oct 27, 2023
1 parent 7846c96 commit a28241e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
]
THIRD_PARTY_APPS = [
"crispy_forms",
"crispy_bootstrap5",
"allauth",
"allauth.account",
"allauth.socialaccount",
Expand Down
2 changes: 2 additions & 0 deletions gregor_django/gregor_anvil/adapters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from anvil_consortium_manager.adapters.account import BaseAccountAdapter
from anvil_consortium_manager.adapters.workspace import BaseWorkspaceAdapter
from anvil_consortium_manager.filters import AccountListFilter
from anvil_consortium_manager.forms import WorkspaceForm
from django.db.models import Q

Expand All @@ -10,6 +11,7 @@ class AccountAdapter(BaseAccountAdapter):
"""Custom account adapter for PRIMED."""

list_table_class = tables.AccountTable
list_filterset_class = AccountListFilter

def get_autocomplete_queryset(self, queryset, q):
"""Filter to Accounts where the email or the associated user name matches the query `q`."""
Expand Down

0 comments on commit a28241e

Please sign in to comment.