diff --git a/pages/copyvios.mako b/pages/copyvios.mako index b4b4b32..a859225 100644 --- a/pages/copyvios.mako +++ b/pages/copyvios.mako @@ -15,10 +15,10 @@ def get_results(bot, lang, project, name, all_projects, title, url, query): site = get_site(bot, lang, project, name, all_projects) if not site: - return None, None + return None, None, None page = site.get_page(title) if page.exists in [page.PAGE_MISSING, page.PAGE_INVALID]: - return page, None + return site, page, None # if url: # result = get_url_specific_results(page, url) @@ -37,7 +37,7 @@ result.cached = False result.tdiff = time() - tstart # END TEST BLOCK - return page, result + return site, page, result def get_site(bot, lang, project, name, all_projects): if project not in [proj[0] for proj in all_projects]: @@ -285,10 +285,10 @@ return url %>\ <% - lang = project = name = title = url = None + lang = orig_lang = project = name = title = url = None query = parse_qs(environ["QUERY_STRING"]) if "lang" in query: - lang = query["lang"][0].decode("utf8").lower() + lang = orig_lang = query["lang"][0].decode("utf8").lower() if "::" in lang: lang, name = lang.split("::", 1) if "project" in query: @@ -298,13 +298,13 @@ if "url" in query: url = query["url"][0].decode("utf8") bot = Bot(".earwigbot") - site = bot.wiki.get_site() + default_site = bot.wiki.get_site() all_langs, all_projects = get_sites(bot) if lang and project and title: - page, result = get_results(bot, lang, project, name, all_projects, - title, url, query) + site, page, result = get_results(bot, lang, project, name, + all_projects, title, url, query) else: - page = result = None + site, page, result = default_site, None, None %>\ <%include file="/support/header.mako" args="environ=environ, title='Copyvio Detector', add_css=('copyvios.css',), add_js=('copyvios.js',)"/>