Fixed missing lower() in waifu/husbando insert

This commit is contained in:
mrhanky 2017-07-06 19:17:03 +02:00
parent 3e86c605f8
commit dba70a7910
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8

View File

@ -111,7 +111,7 @@ class Useless(DatabasePlugin):
insert into
users (nick, waifu)
values
(%s, %s)
(lower(%s), %s)
on conflict (nick) do update set
waifu = excluded.waifu
''', [mask.nick, waifu])
@ -148,17 +148,21 @@ class Useless(DatabasePlugin):
if nick.startswith('='):
nick = nick[1:]
self.cur.execute('''
insert into
users (nick, husbando)
values
(%s, %s)
on conflict (nick) do update set
husbando = excluded.husbando
''', [mask.nick, nick])
try:
self.cur.execute('''
insert into
users (nick, husbando)
values
(lower(%s), %s)
on conflict (nick) do update set
husbando = excluded.husbando
''', [mask.nick, nick])
self.bot.notice(mask.nick, 'Husbando set to: {husbando}'
.format(husbando=nick))
self.bot.notice(mask.nick, 'Husbando set to: {husbando}'
.format(husbando=nick))
except Error:
print(ex)
self.con.rollback()
else:
self.cur.execute('''
select