mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-27 12:08:32 +03:00
Return suspended status when querying user account (#17952)
This commit is contained in:
parent
4c67d20af7
commit
4587decd67
4 changed files with 5 additions and 1 deletions
1
changelog.d/17952.misc
Normal file
1
changelog.d/17952.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Return whether the user is suspended when querying the user account in the Admin API.
|
|
@ -55,7 +55,8 @@ It returns a JSON body like the following:
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"user_type": null,
|
"user_type": null,
|
||||||
"locked": false
|
"locked": false,
|
||||||
|
"suspended": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ class AdminHandler:
|
||||||
"consent_ts": user_info.consent_ts,
|
"consent_ts": user_info.consent_ts,
|
||||||
"user_type": user_info.user_type,
|
"user_type": user_info.user_type,
|
||||||
"is_guest": user_info.is_guest,
|
"is_guest": user_info.is_guest,
|
||||||
|
"suspended": user_info.suspended,
|
||||||
}
|
}
|
||||||
|
|
||||||
if self._msc3866_enabled:
|
if self._msc3866_enabled:
|
||||||
|
|
|
@ -3222,6 +3222,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
|
||||||
self.assertIn("consent_ts", content)
|
self.assertIn("consent_ts", content)
|
||||||
self.assertIn("external_ids", content)
|
self.assertIn("external_ids", content)
|
||||||
self.assertIn("last_seen_ts", content)
|
self.assertIn("last_seen_ts", content)
|
||||||
|
self.assertIn("suspended", content)
|
||||||
|
|
||||||
# This key was removed intentionally. Ensure it is not accidentally re-included.
|
# This key was removed intentionally. Ensure it is not accidentally re-included.
|
||||||
self.assertNotIn("password_hash", content)
|
self.assertNotIn("password_hash", content)
|
||||||
|
|
Loading…
Reference in a new issue