From 0462d3b8a2e68ca8f3c6c57372ddc46d3c328fac Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Fri, 16 Jun 2017 12:02:24 +0300 Subject: [PATCH] fixed a rare bug (when you remove the title of the torrent from the URL) --- magneticow/magneticow/magneticow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magneticow/magneticow/magneticow.py b/magneticow/magneticow/magneticow.py index 0b34715..68b8f46 100644 --- a/magneticow/magneticow/magneticow.py +++ b/magneticow/magneticow/magneticow.py @@ -188,8 +188,8 @@ def torrent_redirect(**kwargs): except (AssertionError, ValueError): # In case info_hash variable is not a proper hex-encoded bytes return flask.abort(400) - with magnetico_db: - cur = magnetico_db.execute("SELECT name FROM torrents WHERE info_hash=? LIMIT 1;", (info_hash,)) + with magneticod_db: + cur = magneticod_db.execute("SELECT name FROM torrents WHERE info_hash=? LIMIT 1;", (info_hash,)) try: name = cur.fetchone()[0] except TypeError: # In case no results returned, TypeError will be raised when we try to subscript None object