diff options
author | Alexander Fechler <141915399+afechler@users.noreply.github.com> | 2024-03-11 17:08:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 16:08:04 +0000 |
commit | 48f59d3806477d575350fa4dc093e02cf0eca901 (patch) | |
tree | 220d8edae91593a935d72d1763e73438fc73c6d6 /synapse/storage | |
parent | Stabilize support for Retry-After header (MSC4014) (#16947) (diff) | |
download | synapse-48f59d3806477d575350fa4dc093e02cf0eca901.tar.xz |
deactivated flag refactored to filter deactivated users. (#16874)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/databases/main/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/__init__.py b/synapse/storage/databases/main/__init__.py index 394985d87f..bf779587d9 100644 --- a/synapse/storage/databases/main/__init__.py +++ b/synapse/storage/databases/main/__init__.py @@ -176,7 +176,7 @@ class DataStore( user_id: Optional[str] = None, name: Optional[str] = None, guests: bool = True, - deactivated: bool = False, + deactivated: Optional[bool] = None, admins: Optional[bool] = None, order_by: str = UserSortOrder.NAME.value, direction: Direction = Direction.FORWARDS, @@ -232,8 +232,11 @@ class DataStore( if not guests: filters.append("is_guest = 0") - if not deactivated: - filters.append("deactivated = 0") + if deactivated is not None: + if deactivated: + filters.append("deactivated = 1") + else: + filters.append("deactivated = 0") if not locked: filters.append("locked IS FALSE") |