From e0a67f5e18ec5efb594772aee4ff825e5c23044f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 2 Jul 2022 11:06:48 -0700 Subject: [PATCH] Uses := syntax in user admin view I learned this! It's cool. --- bookwyrm/views/admin/user_admin.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bookwyrm/views/admin/user_admin.py b/bookwyrm/views/admin/user_admin.py index df716d2cb..f1bb87a88 100644 --- a/bookwyrm/views/admin/user_admin.py +++ b/bookwyrm/views/admin/user_admin.py @@ -22,19 +22,16 @@ class UserAdminList(View): def get(self, request, status="local"): """list of users""" filters = {} - server = request.GET.get("server") - if server: + if server := request.GET.get("server"): server = models.FederatedServer.objects.filter(server_name=server).first() filters["federated_server"] = server filters["federated_server__isnull"] = False - username = request.GET.get("username") - if username: + if username := request.GET.get("username"): filters["username__icontains"] = username scope = request.GET.get("scope") if scope and scope == "local": filters["local"] = True - email = request.GET.get("email") - if email: + if email := request.GET.get("email"): filters["email__endswith"] = email filters["local"] = status == "local"