summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/7377.misc2
-rw-r--r--changelog.d/8163.misc1
-rw-r--r--docs/admin_api/user_admin_api.rst7
-rw-r--r--synapse/storage/databases/main/__init__.py2
4 files changed, 7 insertions, 5 deletions
diff --git a/changelog.d/7377.misc b/changelog.d/7377.misc
index 67e2da0dcb..b3ec08855b 100644
--- a/changelog.d/7377.misc
+++ b/changelog.d/7377.misc
@@ -1 +1 @@
-Search in columns 'name' and 'displayname' in the admin users endpoint. Contributed by Awesome Technologies Innovationslabor GmbH.
+Add filter `name` to the `/users` admin API, which filters by user ID or displayname. Contributed by Awesome Technologies Innovationslabor GmbH.
diff --git a/changelog.d/8163.misc b/changelog.d/8163.misc
new file mode 100644
index 0000000000..b3ec08855b
--- /dev/null
+++ b/changelog.d/8163.misc
@@ -0,0 +1 @@
+Add filter `name` to the `/users` admin API, which filters by user ID or displayname. Contributed by Awesome Technologies Innovationslabor GmbH.
diff --git a/docs/admin_api/user_admin_api.rst b/docs/admin_api/user_admin_api.rst
index 9cb924895f..d6e3194cda 100644
--- a/docs/admin_api/user_admin_api.rst
+++ b/docs/admin_api/user_admin_api.rst
@@ -119,10 +119,11 @@ from a previous call.
 The parameter ``limit`` is optional but is used for pagination, denoting the
 maximum number of items to return in this call. Defaults to ``100``.
 
-The parameter ``user_id`` is optional and can be used to filter by user id.
+The parameter ``user_id`` is optional and filters to only return users with user IDs
+that contain this value. This parameter is ignored when using the ``name`` parameter.
 
-The parameter ``name`` is optional and can be used to list only users with the
-local part of the user ID or display name that contain this value.
+The parameter ``name`` is optional and filters to only return users with user ID localparts
+**or** displaynames that contain this value.
 
 The parameter ``guests`` is optional and if ``false`` will **exclude** guest users.
 Defaults to ``true`` to include guest users.
diff --git a/synapse/storage/databases/main/__init__.py b/synapse/storage/databases/main/__init__.py
index 0ed726fee0..0934ae276c 100644
--- a/synapse/storage/databases/main/__init__.py
+++ b/synapse/storage/databases/main/__init__.py
@@ -507,7 +507,7 @@ class DataStore(
         Args:
             start (int): start number to begin the query from
             limit (int): number of rows to retrieve
-            user_id (string): search for user_id
+            user_id (string): search for user_id. ignored if name is not None
             name (string): search for local part of user_id or display name
             guests (bool): whether to in include guest users
             deactivated (bool): whether to include deactivated users