Skip to content

Commit 4587dec

Browse files
authored
Return suspended status when querying user account (#17952)
1 parent 4c67d20 commit 4587dec

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

changelog.d/17952.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Return whether the user is suspended when querying the user account in the Admin API.

docs/admin_api/user_admin_api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ It returns a JSON body like the following:
5555
}
5656
],
5757
"user_type": null,
58-
"locked": false
58+
"locked": false,
59+
"suspended": false
5960
}
6061
```
6162

synapse/handlers/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ async def get_user(self, user: UserID) -> Optional[JsonMapping]:
124124
"consent_ts": user_info.consent_ts,
125125
"user_type": user_info.user_type,
126126
"is_guest": user_info.is_guest,
127+
"suspended": user_info.suspended,
127128
}
128129

129130
if self._msc3866_enabled:

tests/rest/admin/test_user.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3222,6 +3222,7 @@ def _check_fields(self, content: JsonDict) -> None:
32223222
self.assertIn("consent_ts", content)
32233223
self.assertIn("external_ids", content)
32243224
self.assertIn("last_seen_ts", content)
3225+
self.assertIn("suspended", content)
32253226

32263227
# This key was removed intentionally. Ensure it is not accidentally re-included.
32273228
self.assertNotIn("password_hash", content)

0 commit comments

Comments
 (0)