aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2015-11-30 13:38:27 -0600
committerAndy Doan <andy.doan@linaro.org>2015-11-30 13:39:39 -0600
commit54465b6f5a6bacc7e1c6a510dc132419460ee3c6 (patch)
tree01789e81a0b64092e3caee850ef1974944637f1d
parent3bfc0797969f4acc8c8845588c5b6882b89332a3 (diff)
reports: Minor fixes for issues found in production
This fixes 2 issues: 1) ignore the Yandex web crawler. I found this while looking at our download logs 2) don't show reports for items not yet populated with a country/isp. This needs to get filled in by a management command I'm about to send out for review. Change-Id: Ia79d7d3e89420b5ea22315dfabc1f66a4fa08758
-rw-r--r--license_protected_downloads/models.py2
-rw-r--r--settings.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/license_protected_downloads/models.py b/license_protected_downloads/models.py
index d91ea65..625803c 100644
--- a/license_protected_downloads/models.py
+++ b/license_protected_downloads/models.py
@@ -140,7 +140,7 @@ class Download(models.Model):
start = datetime.datetime.strptime(year_month, '%Y.%m')
end = Download.next_month(start)
return Download.objects.filter(
- timestamp__gte=start, timestamp__lte=end)
+ timestamp__gte=start, timestamp__lte=end).exclude(country=None)
@staticmethod
def report(year_month, column_name, **extra_filters):
diff --git a/settings.py b/settings.py
index fd168f7..fc22af3 100644
--- a/settings.py
+++ b/settings.py
@@ -267,7 +267,10 @@ TAB_PRIORITY = ['Release Notes',
'OpenJDK']
BASE_PAGE = 'header.html'
-BOT_USER_AGENTS = ['Googlebot/2', 'bingbot/2', 'Yahoo! Slurp', 'Baiduspider/2']
+BOT_USER_AGENTS = [
+ 'Googlebot/2', 'bingbot/2', 'Yahoo! Slurp', 'Baiduspider/2',
+ 'YandexBot/3.0',
+]
MASTER_API_KEY = ""
TRACK_DOWNLOAD_STATS = False