From c200c295e71bdd43db5f0bb10a34e3998da37e13 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Sun, 31 Mar 2024 18:23:35 -0400 Subject: [PATCH] ensure config key is formatted properly --- relay/database/connection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/relay/database/connection.py b/relay/database/connection.py index 67ef5c0..f8de1c0 100644 --- a/relay/database/connection.py +++ b/relay/database/connection.py @@ -54,6 +54,8 @@ class Connection(SqlConnection): def get_config(self, key: str) -> Any: + key = key.replace('_', '-') + with self.run('get-config', {'key': key}) as cur: if not (row := cur.one()): return ConfigData.DEFAULT(key) @@ -72,10 +74,10 @@ class Connection(SqlConnection): field = ConfigData.FIELD(key) key = field.name.replace('_', '-') - if key == 'private_key': + if key == 'private-key': self.app.signer = value - elif key == 'log_level': + elif key == 'log-level': value = logging.LogLevel.parse(value) logging.set_level(value)