From d2dff9f05d781c3d8b957706f829f6a28d4a141a Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 30 Jun 2014 17:36:11 -0400 Subject: [PATCH] Fix bad URI error thing. --- copyvios/checker.py | 2 +- templates/index.mako | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/copyvios/checker.py b/copyvios/checker.py index d864193..4abca98 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -35,7 +35,7 @@ def _get_results(query): if query.url: if urlparse(query.url).scheme not in ["http", "https"]: - query.result = "bad URI" + query.error = "bad URI" return query.result = page.copyvio_compare(query.url) query.result.cached = False diff --git a/templates/index.mako b/templates/index.mako index 7c65468..9adb565 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -1,11 +1,13 @@ -<%! - from flask import g, request -%>\ +<%! from flask import g, request %>\ <%include file="/support/header.mako" args="title='Earwig\'s Copyvio Detector'"/> <%namespace module="copyvios.highlighter" import="highlight_delta"/>\ <%namespace module="copyvios.misc" import="urlstrip"/>\ % if query.project and query.lang and (query.title or query.oldid): - % if not query.site: + % if query.error == "bad URI": +
+

Unsupported URI scheme: ${query.url | h}.

+
+ % elif not query.site:

The given site (project=${query.project | h}, language=${query.lang | h}) doesn't seem to exist. It may also be closed or private. Confirm its URL.

@@ -17,11 +19,6 @@

The given revision ID doesn't seem to exist: ${query.oldid | h}.

- % elif query.url and result == "bad URI": - <% result = None %> -
-

Unsupported URI scheme: ${query.url | h}.

-
% endif %endif

This tool attempts to detect copyright violations in articles. Simply give the title of the page or ID of the revision you want to check and hit Submit. The tool will search for similar content elsewhere on the web using Yahoo! BOSS and then display a report if a match is found. If you give a URL, it will skip the search engine step and directly display a report comparing the article to that particular webpage, like the Duplication Detector.