summary refs log tree commit diff
path: root/synapse/handlers/set_password.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-01-26 10:50:21 -0500
committerGitHub <noreply@github.com>2021-01-26 10:50:21 -0500
commit1baab2035265cf2543fe3c0ef5412c1ac0740c7e (patch)
treecb1b9911d3ad794be081378031cfcdc72939f73f /synapse/handlers/set_password.py
parentDo not require the CAS service URL setting (use public_baseurl instead). (#9199) (diff)
downloadsynapse-1baab2035265cf2543fe3c0ef5412c1ac0740c7e.tar.xz
Add type hints to various handlers. (#9223)
With this change all handlers except the e2e_* ones have
type hints enabled.
Diffstat (limited to 'synapse/handlers/set_password.py')
-rw-r--r--synapse/handlers/set_password.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/handlers/set_password.py b/synapse/handlers/set_password.py
index a5d67f828f..84af2dde7e 100644
--- a/synapse/handlers/set_password.py
+++ b/synapse/handlers/set_password.py
@@ -13,24 +13,26 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 import logging
-from typing import Optional
+from typing import TYPE_CHECKING, Optional
 
 from synapse.api.errors import Codes, StoreError, SynapseError
 from synapse.types import Requester
 
 from ._base import BaseHandler
 
+if TYPE_CHECKING:
+    from synapse.app.homeserver import HomeServer
+
 logger = logging.getLogger(__name__)
 
 
 class SetPasswordHandler(BaseHandler):
     """Handler which deals with changing user account passwords"""
 
-    def __init__(self, hs):
+    def __init__(self, hs: "HomeServer"):
         super().__init__(hs)
         self._auth_handler = hs.get_auth_handler()
         self._device_handler = hs.get_device_handler()
-        self._password_policy_handler = hs.get_password_policy_handler()
 
     async def set_password(
         self,
@@ -38,7 +40,7 @@ class SetPasswordHandler(BaseHandler):
         password_hash: str,
         logout_devices: bool,
         requester: Optional[Requester] = None,
-    ):
+    ) -> None:
         if not self.hs.config.password_localdb_enabled:
             raise SynapseError(403, "Password change disabled", errcode=Codes.FORBIDDEN)