mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-18 02:52:42 +03:00
Add special case in setting for lists to avoid storing as strings
The `get_list` does a type check if the value returned is a list, and returns default otherwise. Since we were storing everything as a string, if something set a list after the initial migration to toml, that key would then always be returned as the default value
This commit is contained in:
1 parent
d4ac2fe8b1
commit
a667882189
1 file changed
+4
-1
+4
-1
@@ -501,7 +501,10 @@ class Config:
|
||||
|
||||
def set(self, key: str, value: Any):
|
||||
"""Modify a setting and save to disk."""
|
||||
self.settings[key.lower()] = str(value)
|
||||
if isinstance(value, list):
|
||||
self.settings[key.lower()] = value
|
||||
else:
|
||||
self.settings[key.lower()] = str(value)
|
||||
self.save()
|
||||
|
||||
def save(self):
|
||||
|
||||
Reference in new issue
Block a user