Merge pull request #1297 from bookwyrm-social/admin-filter

Adds local only filter to user admin view
This commit is contained in:
Mouse Reeve 2021-08-16 10:56:24 -06:00 committed by GitHub
commit dfed212b12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -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 %}

View file

@ -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)