summary refs log tree commit diff
path: root/synapse/config/consent.py
diff options
context:
space:
mode:
authorAzrenbeth <7782548+Azrenbeth@users.noreply.github.com>2021-09-28 16:15:58 +0100
committerAzrenbeth <7782548+Azrenbeth@users.noreply.github.com>2021-09-28 16:15:58 +0100
commitdb6cc8f35b739b4db84a58f5226f79e6fad61978 (patch)
treed76d4fa3f80eda9d28b999fab5e1cfc349da09c7 /synapse/config/consent.py
parentTidy up documentation a bit (diff)
parentDrop backwards-compatibility support for "outlier" (#10903) (diff)
downloadsynapse-db6cc8f35b739b4db84a58f5226f79e6fad61978.tar.xz
Merge remote-tracking branch 'origin/develop' into azren/compressor_integration
Diffstat (limited to 'synapse/config/consent.py')
-rw-r--r--synapse/config/consent.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/config/consent.py b/synapse/config/consent.py
index b05a9bd97f..ecc43b08b9 100644
--- a/synapse/config/consent.py
+++ b/synapse/config/consent.py
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 from os import path
+from typing import Optional
 
 from synapse.config import ConfigError
 
@@ -78,8 +79,8 @@ class ConsentConfig(Config):
     def __init__(self, *args):
         super().__init__(*args)
 
-        self.user_consent_version = None
-        self.user_consent_template_dir = None
+        self.user_consent_version: Optional[str] = None
+        self.user_consent_template_dir: Optional[str] = None
         self.user_consent_server_notice_content = None
         self.user_consent_server_notice_to_guests = False
         self.block_events_without_consent_error = None
@@ -94,7 +95,9 @@ class ConsentConfig(Config):
             return
         self.user_consent_version = str(consent_config["version"])
         self.user_consent_template_dir = self.abspath(consent_config["template_dir"])
-        if not path.isdir(self.user_consent_template_dir):
+        if not isinstance(self.user_consent_template_dir, str) or not path.isdir(
+            self.user_consent_template_dir
+        ):
             raise ConfigError(
                 "Could not find template directory '%s'"
                 % (self.user_consent_template_dir,)