Compare commits

...

2 commits

Author SHA1 Message Date
Izalia Mae cab8ca81c6 Merge branch 'dev' into 'main'
version 0.3.1

See merge request pleroma/relay!58
2024-03-31 22:24:06 +00:00
Izalia Mae c200c295e7 ensure config key is formatted properly 2024-03-31 18:23:35 -04:00

View file

@ -54,6 +54,8 @@ class Connection(SqlConnection):
def get_config(self, key: str) -> Any: def get_config(self, key: str) -> Any:
key = key.replace('_', '-')
with self.run('get-config', {'key': key}) as cur: with self.run('get-config', {'key': key}) as cur:
if not (row := cur.one()): if not (row := cur.one()):
return ConfigData.DEFAULT(key) return ConfigData.DEFAULT(key)
@ -72,10 +74,10 @@ class Connection(SqlConnection):
field = ConfigData.FIELD(key) field = ConfigData.FIELD(key)
key = field.name.replace('_', '-') key = field.name.replace('_', '-')
if key == 'private_key': if key == 'private-key':
self.app.signer = value self.app.signer = value
elif key == 'log_level': elif key == 'log-level':
value = logging.LogLevel.parse(value) value = logging.LogLevel.parse(value)
logging.set_level(value) logging.set_level(value)