summary refs log tree commit diff
path: root/synapse/rest/consent
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-05-18 15:41:40 +0100
committerRichard van der Hoff <richard@matrix.org>2018-05-22 11:54:51 +0100
commitd5dca9a04fbac7fea0822eaf2fd513b13449184c (patch)
tree8d2f5e5a6f21f6461b64878f3fef6f2e5500e3ce /synapse/rest/consent
parentSend users a server notice about consent (diff)
downloadsynapse-d5dca9a04fbac7fea0822eaf2fd513b13449184c.tar.xz
Move consent config parsing into ConsentConfig
turns out we need to reuse this, so it's better in the config class.
Diffstat (limited to 'synapse/rest/consent')
-rw-r--r--synapse/rest/consent/consent_resource.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/rest/consent/consent_resource.py b/synapse/rest/consent/consent_resource.py
index b0536ee375..306385601c 100644
--- a/synapse/rest/consent/consent_resource.py
+++ b/synapse/rest/consent/consent_resource.py
@@ -95,8 +95,8 @@ class ConsentResource(Resource):
         # this is required by the request_handler wrapper
         self.clock = hs.get_clock()
 
-        consent_config = hs.config.consent_config
-        if consent_config is None:
+        self._default_consent_verison = hs.config.user_consent_version
+        if self._default_consent_verison is None:
             raise ConfigError(
                 "Consent resource is enabled but user_consent section is "
                 "missing in config file.",
@@ -104,7 +104,7 @@ class ConsentResource(Resource):
 
         # daemonize changes the cwd to /, so make the path absolute now.
         consent_template_directory = path.abspath(
-            consent_config["template_dir"],
+            hs.config.user_consent_template_dir,
         )
         if not path.isdir(consent_template_directory):
             raise ConfigError(
@@ -116,8 +116,6 @@ class ConsentResource(Resource):
         loader = jinja2.FileSystemLoader(consent_template_directory)
         self._jinja_env = jinja2.Environment(loader=loader)
 
-        self._default_consent_verison = consent_config["version"]
-
         if hs.config.form_secret is None:
             raise ConfigError(
                 "Consent resource is enabled but form_secret is not set in "