mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 20:24:51 -04:00
Add missing type hints to the admin API servlets (#10105)
This commit is contained in:
parent
fa1db8f156
commit
d558292548
6 changed files with 48 additions and 40 deletions
|
@ -478,13 +478,12 @@ class UserRegisterServlet(RestServlet):
|
|||
|
||||
class WhoisRestServlet(RestServlet):
|
||||
path_regex = "/whois/(?P<user_id>[^/]*)$"
|
||||
PATTERNS = (
|
||||
admin_patterns(path_regex)
|
||||
+
|
||||
PATTERNS = [
|
||||
*admin_patterns(path_regex),
|
||||
# URL for spec reason
|
||||
# https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid
|
||||
client_patterns("/admin" + path_regex, v1=True)
|
||||
)
|
||||
*client_patterns("/admin" + path_regex, v1=True),
|
||||
]
|
||||
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.hs = hs
|
||||
|
@ -553,11 +552,7 @@ class DeactivateAccountRestServlet(RestServlet):
|
|||
class AccountValidityRenewServlet(RestServlet):
|
||||
PATTERNS = admin_patterns("/account_validity/validity$")
|
||||
|
||||
def __init__(self, hs):
|
||||
"""
|
||||
Args:
|
||||
hs (synapse.server.HomeServer): server
|
||||
"""
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.hs = hs
|
||||
self.account_activity_handler = hs.get_account_validity_handler()
|
||||
self.auth = hs.get_auth()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue