From 6a381c66f17a8ddbe6ee8a1e91e42d2c826c3166 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 5 Dec 2012 16:55:17 -0500 Subject: [PATCH] Fix a bug regarding updating the 'all' site. --- earwigbot/wiki/copyvios/exclusions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/earwigbot/wiki/copyvios/exclusions.py b/earwigbot/wiki/copyvios/exclusions.py index 2a0fb28..590f6ef 100644 --- a/earwigbot/wiki/copyvios/exclusions.py +++ b/earwigbot/wiki/copyvios/exclusions.py @@ -31,7 +31,7 @@ from earwigbot import exceptions __all__ = ["ExclusionsDB"] default_sources = { - "all": [ + "all": [ # Applies to all, but located on enwiki "User:EarwigBot/Copyvios/Exclusions" ], "enwiki": [ @@ -109,7 +109,10 @@ class ExclusionsDB(object): query6 = "UPDATE updates SET update_time = ? WHERE update_sitename = ?;" query7 = "INSERT INTO updates VALUES (?, ?);" - site = self._sitesdb.get_site(sitename) + if sitename == "all": + site = self._sitesdb.get_site("enwiki") + else: + site = self._sitesdb.get_site(sitename) with sqlite.connect(self._dbfile) as conn, self._db_access_lock: urls = set() for (source,) in conn.execute(query1, (sitename,)):