Pārlūkot izejas kodu

Silly SQL, that's not what I told you to do.

tags/v0.2
Ben Kurtovic pirms 11 gadiem
vecāks
revīzija
ca7cbceb4a
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. +3
    -3
      earwigbot/config/permissions.py

+ 3
- 3
earwigbot/config/permissions.py Parādīt failu

@@ -183,10 +183,10 @@ class PermissionsDB(object):
query3 = """UPDATE attributes SET attr_value = ? WHERE attr_uid = ?
AND attr_key = ?"""
with self._db_access_lock, sqlite.connect(self._dbfile) as conn:
if conn.execute(query1, (user, key)):
conn.execute(query2, (user, key, value))
else:
if conn.execute(query1, (user, key)).fetchone():
conn.execute(query3, (value, user, key))
else:
conn.execute(query2, (user, key, value))
try:
self._attributes[user][key] = value
except KeyError:


Notiek ielāde…
Atcelt
Saglabāt