Don't try to log into a nonexisting clickthrus table for now

This commit is contained in:
Magnus Hagander
2011-11-27 19:08:05 +01:00
parent 5e4591cb6f
commit 2e07b3b30f

View File

@ -111,16 +111,16 @@ def mirrorselect(request, path):
# them to our master mirrors again.
def _mirror_redirect_internal(request, scheme, host, path):
# Log the access
curs = connection.cursor()
curs.execute("""INSERT INTO clickthrus (scheme, host, path, country)
VALUES (%(scheme)s, %(host)s, %(path)s, (
SELECT countrycode FROM iptocountry WHERE %(ip)s BETWEEN startip and endip LIMIT 1))""", {
'scheme': scheme,
'host': host,
'path': path,
'ip': _get_numeric_ip(request),
})
transaction.commit_unless_managed()
# curs = connection.cursor()
# curs.execute("""INSERT INTO clickthrus (scheme, host, path, country)
#VALUES (%(scheme)s, %(host)s, %(path)s, (
#SELECT countrycode FROM iptocountry WHERE %(ip)s BETWEEN startip and endip LIMIT 1))""", {
# 'scheme': scheme,
# 'host': host,
# 'path': path,
# 'ip': _get_numeric_ip(request),
#})
# transaction.commit_unless_managed()
# Redirect!
newurl = "%s://%s/%s" % (scheme, host, path)