Turns out we didn't need find_all_by_setting

This commit is contained in:
jesopo 2018-08-31 15:17:15 +01:00
parent 8a80d8e67d
commit 303cf85ac6

View file

@ -219,18 +219,6 @@ class UserChannelSettings(Table):
values[i] = value[0], json.loads(value[1])
return values
return default
def find_all_by_setting(self, channel_id, setting, default=[]):
values = self.database.execute_fetchall(
"""SELECT users.name, user_channel_settings.value FROM
user_channel_settings INNER JOIN users ON
user_channel_settings.user_id=users.user_id
WHERE user_channel_setting.setting=?
AND user_channel_settings.channel_id=?""", [setting, channel_id])
if values:
for i, value in enumerate(values):
values[i] = value[0], json.loads(value[1])
return values
return default
def delete(self, user_id, channel_id, setting):
self.database.execute(
"""DELETE FROM user_channel_settings WHERE