Skip to content

Commit

Permalink
Search on email address as well as Org name (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
benrometsch authored Jun 25, 2021
1 parent a94cca3 commit db72916
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/sales_dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def get_queryset(self):

if "search" in self.request.GET:
search_term = self.request.GET["search"]
queryset = queryset.filter(name__icontains=search_term)
queryset = queryset.filter(
Q(name__icontains=search_term) | Q(users__email__icontains=search_term)
)

if self.request.GET.get("sort_field"):
sort_field = self.request.GET["sort_field"]
Expand Down

0 comments on commit db72916

Please sign in to comment.