Skip to content

Commit

Permalink
fix: empty nau extended model admin
Browse files Browse the repository at this point in the history
The NAU Extended model admin screen
didn't allow to search empty, so it prevents the export of contacts
to newsletter.
relates to fccn/nau-technical#66
relates to fccn/nau-technical#100
  • Loading branch information
igobranco committed Apr 23, 2024
1 parent 830ace3 commit 4082612
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nau_openedx_extensions/custom_registration_form/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ def openedx_username(self, instance):

def get_search_results(self, request, queryset, search_term):
qs, use_distinct = super().get_search_results(request, queryset, search_term)
if not search_term or len(search_term) < 3:
if search_term and len(search_term) > 0 and len(search_term) < 3:
qs = NauUserExtendedModel.objects.none()
return use_read_replica_if_available(qs), use_distinct

0 comments on commit 4082612

Please sign in to comment.