瀏覽代碼

Fix untrack_page() - I guess you can't parameterize column names.

tags/v0.1^2
Ben Kurtovic 13 年之前
父節點
當前提交
83fe4b7c03
共有 1 個檔案被更改,包括 5 行新增4 行删除
  1. +5
    -4
      bot/tasks/afc_statistics.py

+ 5
- 4
bot/tasks/afc_statistics.py 查看文件

@@ -232,12 +232,13 @@ class Task(BaseTask):
self.track_page(cursor, page)

def untrack_page(self, cursor, pageid=None, title=None):
query = """DELETE FROM page, row USING page JOIN row
ON page_id = row_id WHERE ? = ?"""
query = "DELETE FROM page, row USING page JOIN row ON page_id = row_id WHERE "
if pageid:
cursor.execute(query, ("page_id", pageid))
query += "page_id = ?"
cursor.execute(query, (pageid,))
elif title:
cursor.execute(query, ("page_title", title))
query += "page_title = ?"
cursor.execute(query, (title,))

def track_page(self, cursor, title):
"""Update hook for when page is not in our database."""


Loading…
取消
儲存