From: Michael Tremer Date: Sun, 21 Oct 2012 18:05:06 +0000 (+0200) Subject: Fix counting downloads. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d933f34e7f9ea9fcc0ea66bf195a871c8f6c13e2;p=ipfire.org.git Fix counting downloads. --- diff --git a/www/webapp/handlers_download.py b/www/webapp/handlers_download.py index e45f5028..d7ebaaef 100644 --- a/www/webapp/handlers_download.py +++ b/www/webapp/handlers_download.py @@ -87,11 +87,12 @@ class DownloadFileHandler(BaseHandler): mirror = mirrors.get_random() self.redirect(mirror.url + filename[len(mirror.prefix):]) + return mirror def get(self, filename): - return self.head(filename) + mirror = self.head(filename) - # Record the downlaod. + # Record the download. country_code = self.geoip.get_country(self.request.remote_ip) self.mirrors.db.execute("INSERT INTO log_download(filename, mirror, country_code) VALUES(%s, %s, %s)", filename, mirror.id, country_code)