forked from mirrors/bookwyrm
Merge pull request #1297 from bookwyrm-social/admin-filter
Adds local only filter to user admin view
This commit is contained in:
commit
dfed212b12
2 changed files with 4 additions and 0 deletions
|
@ -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 %}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue