]> git.ipfire.org Git - ipfire.org.git/commitdiff
Fix counting downloads.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Oct 2012 18:05:06 +0000 (20:05 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Oct 2012 18:05:06 +0000 (20:05 +0200)
www/webapp/handlers_download.py

index e45f5028c39b22b37cc3eac9cb2e415e88636a31..d7ebaaef6b52b6a43eaced30156e6049c191a3d3 100644 (file)
@@ -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)