From d14d7b8fdc67f8f784c69605f95fe136e032b5d4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 17 May 2018 12:09:18 +0100 Subject: [PATCH] Rename 'version' param on user consent config we're going to use it for the version we require too. --- synapse/config/consent_config.py | 10 ++++++---- synapse/rest/consent/consent_resource.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/synapse/config/consent_config.py b/synapse/config/consent_config.py index 675fce091..45856b9e8 100644 --- a/synapse/config/consent_config.py +++ b/synapse/config/consent_config.py @@ -18,19 +18,21 @@ from ._base import Config DEFAULT_CONFIG = """\ # User Consent configuration # -# uncomment and configure if enabling the 'consent' resource under 'listeners'. +# Parts of this section are required if enabling the 'consent' resource under +# 'listeners', in particular 'template_dir' and 'version'. # # 'template_dir' gives the location of the templates for the HTML forms. # This directory should contain one subdirectory per language (eg, 'en', 'fr'), # and each language directory should contain the policy document (named as # '.html') and a success page (success.html). # -# 'default_version' gives the version of the policy document to serve up if -# there is no 'v' parameter. +# 'version' specifies the 'current' version of the policy document. It defines +# the version to be served by the consent resource if there is no 'v' +# parameter. # # user_consent: # template_dir: res/templates/privacy -# default_version: 1.0 +# version: 1.0 """ diff --git a/synapse/rest/consent/consent_resource.py b/synapse/rest/consent/consent_resource.py index d79130227..b0536ee37 100644 --- a/synapse/rest/consent/consent_resource.py +++ b/synapse/rest/consent/consent_resource.py @@ -116,7 +116,7 @@ class ConsentResource(Resource): loader = jinja2.FileSystemLoader(consent_template_directory) self._jinja_env = jinja2.Environment(loader=loader) - self._default_consent_verison = consent_config["default_version"] + self._default_consent_verison = consent_config["version"] if hs.config.form_secret is None: raise ConfigError(