Commit 66575acf authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Settings: dict keys need to be strings

json.Encoder does only work for dict values not for keys.
parent 0b27c968
Pipeline #9051 failed with stages
in 4 minutes and 3 seconds
......@@ -106,6 +106,7 @@
_CallbackDict = dict[tuple[str, Optional[str], Optional[JID]],
list[weakref.WeakMethod[_SignalCallable]]]
class Settings:
def __init__(self):
self._con = cast(sqlite3.Connection, None)
......@@ -830,7 +831,7 @@ def set_group_chat_setting(self,
group_chat_settings = self._account_settings[account]['group_chat']
if jid not in group_chat_settings:
group_chat_settings[jid] = {setting: value}
group_chat_settings[str(jid)] = {setting: value}
else:
group_chat_settings[jid][setting] = value
......@@ -909,7 +910,7 @@ def set_contact_setting(self,
contact_settings = self._account_settings[account]['contact']
if jid not in contact_settings:
contact_settings[jid] = {setting: value}
contact_settings[str(jid)] = {setting: value}
else:
contact_settings[jid][setting] = value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment