diff --git a/bookwyrm/views/group.py b/bookwyrm/views/group.py index 6762fc19..c90cc2ac 100644 --- a/bookwyrm/views/group.py +++ b/bookwyrm/views/group.py @@ -122,6 +122,11 @@ class FindUsers(View): """basic profile info""" user_query = request.GET.get("user_query") group = get_object_or_404(models.Group, id=group_id) + lists = ( + models.List.privacy_filter(request.user) + .filter(group=group) + .order_by("-updated_date") + ) if not group: return HttpResponseBadRequest() @@ -143,7 +148,7 @@ class FindUsers(View): .filter(similarity__gt=0.5, local=True) .order_by("-similarity")[:5] ) - data = {"no_results": not user_results} + no_results = not user_results if user_results.count() < 5: user_results = list(user_results) + suggested_users.get_suggestions( @@ -152,7 +157,9 @@ class FindUsers(View): data = { "suggested_users": user_results, + "no_results": no_results, "group": group, + "lists": lists, "group_form": forms.GroupForm(instance=group,auto_id='group_form_id_%s'), "list_form": forms.ListForm(), "user_query": user_query,