From 71404fae0683f77a5001b30896e055e46f98a8ae Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 16 Aug 2021 08:51:23 -0700 Subject: [PATCH] Adds local only filter to user admin view --- bookwyrm/templates/user_admin/user_admin_filters.html | 1 + bookwyrm/views/user_admin.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/bookwyrm/templates/user_admin/user_admin_filters.html b/bookwyrm/templates/user_admin/user_admin_filters.html index 57e017e5f..5283b4e9c 100644 --- a/bookwyrm/templates/user_admin/user_admin_filters.html +++ b/bookwyrm/templates/user_admin/user_admin_filters.html @@ -3,4 +3,5 @@ {% block filter_fields %} {% include 'user_admin/server_filter.html' %} {% include 'user_admin/username_filter.html' %} +{% include 'directory/community_filter.html' %} {% endblock %} diff --git a/bookwyrm/views/user_admin.py b/bookwyrm/views/user_admin.py index 9d08e9309..7cfefb0f4 100644 --- a/bookwyrm/views/user_admin.py +++ b/bookwyrm/views/user_admin.py @@ -30,6 +30,9 @@ class UserAdminList(View): username = request.GET.get("username") if username: filters["username__icontains"] = username + scope = request.GET.get("scope") + if scope: + filters["local"] = scope == "local" users = models.User.objects.filter(**filters)