mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 01:50:34 +00:00
show group lists on group FindUsers page
This commit is contained in:
parent
b1fa57d2ca
commit
045506d6e0
1 changed files with 8 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue