diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-04-11 12:07:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 12:07:23 -0400 |
commit | 4586119f0b0901be64f08655d3aaaef289a51bde (patch) | |
tree | 8150ea6084a6a7a034d272654720333d01b75b9f /synapse/config/registration.py | |
parent | Enable certificate checking during complement tests (#12435) (diff) | |
download | synapse-4586119f0b0901be64f08655d3aaaef289a51bde.tar.xz |
Add missing type hints to config classes. (#12402)
Diffstat (limited to 'synapse/config/registration.py')
-rw-r--r-- | synapse/config/registration.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py index 40fb329a7f..39e9acb62a 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py @@ -13,18 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. import argparse -from typing import Optional +from typing import Any, Optional from synapse.api.constants import RoomCreationPreset from synapse.config._base import Config, ConfigError -from synapse.types import RoomAlias, UserID +from synapse.types import JsonDict, RoomAlias, UserID from synapse.util.stringutils import random_string_with_symbols, strtobool class RegistrationConfig(Config): section = "registration" - def read_config(self, config, **kwargs): + def read_config(self, config: JsonDict, **kwargs: Any) -> None: self.enable_registration = strtobool( str(config.get("enable_registration", False)) ) @@ -196,7 +196,9 @@ class RegistrationConfig(Config): self.inhibit_user_in_use_error = config.get("inhibit_user_in_use_error", False) - def generate_config_section(self, generate_secrets=False, **kwargs): + def generate_config_section( + self, generate_secrets: bool = False, **kwargs: Any + ) -> str: if generate_secrets: registration_shared_secret = 'registration_shared_secret: "%s"' % ( random_string_with_symbols(50), |