mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 12:32:11 -04:00
Add a type hint for get_device_handler()
and fix incorrect types. (#14055)
This was the last untyped handler from the HomeServer object. Since it was being treated as Any (and thus unchecked) it was being used incorrectly in a few places.
This commit is contained in:
parent
9b4cb1e2ed
commit
6d47b7e325
16 changed files with 185 additions and 77 deletions
|
@ -16,6 +16,7 @@ import logging
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.handlers.device import DeviceHandler
|
||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.types import Codes, Requester, UserID, create_requester
|
||||
|
||||
|
@ -76,6 +77,9 @@ class DeactivateAccountHandler:
|
|||
True if identity server supports removing threepids, otherwise False.
|
||||
"""
|
||||
|
||||
# This can only be called on the main process.
|
||||
assert isinstance(self._device_handler, DeviceHandler)
|
||||
|
||||
# Check if this user can be deactivated
|
||||
if not await self._third_party_rules.check_can_deactivate_user(
|
||||
user_id, by_admin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue