Fix Database.ChannelSettings.find SQL

This commit is contained in:
jesopo 2019-06-17 17:51:27 +01:00
parent 738a353c52
commit d4391cc6c5

View file

@ -146,7 +146,7 @@ class ChannelSettings(Table):
def find(self, channel_id: int, pattern: str, default: typing.Any=[]): def find(self, channel_id: int, pattern: str, default: typing.Any=[]):
values = self.database.execute_fetchall( values = self.database.execute_fetchall(
"""SELECT setting, value FROM channel_settings WHERE """SELECT setting, value FROM channel_settings WHERE
channel_id=? setting LIKE '?'""", [channel_id, pattern.lower()]) channel_id=? AND setting LIKE ?""", [channel_id, pattern.lower()])
if values: if values:
for i, value in enumerate(values): for i, value in enumerate(values):
values[i] = value[0], json.loads(value[1]) values[i] = value[0], json.loads(value[1])