mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-15 06:10:41 -05:00
Refactor HomeserverConfig so it can be typechecked (#6137)
This commit is contained in:
parent
def5413480
commit
f743108a94
37 changed files with 415 additions and 94 deletions
|
|
@ -24,6 +24,8 @@ from synapse.util.stringutils import random_string_with_symbols
|
|||
|
||||
|
||||
class AccountValidityConfig(Config):
|
||||
section = "accountvalidity"
|
||||
|
||||
def __init__(self, config, synapse_config):
|
||||
self.enabled = config.get("enabled", False)
|
||||
self.renew_by_email_enabled = "renew_at" in config
|
||||
|
|
@ -77,6 +79,8 @@ class AccountValidityConfig(Config):
|
|||
|
||||
|
||||
class RegistrationConfig(Config):
|
||||
section = "registration"
|
||||
|
||||
def read_config(self, config, **kwargs):
|
||||
self.enable_registration = bool(
|
||||
strtobool(str(config.get("enable_registration", False)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue