Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmon committed Feb 25, 2016
1 parent 9763dfc commit cf20db1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
7 changes: 4 additions & 3 deletions kitsune/kpi/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from operator import itemgetter
from collections import defaultdict
from datetime import date, timedelta
from operator import itemgetter

from django.core.cache import cache
from django.db import connections, router
Expand Down Expand Up @@ -367,12 +368,12 @@ def _remap_date_counts(**kwargs):
...]
"""
for label, qs in kwargs.iteritems():
res = {}
res = defaultdict(lambda: {label: 0})
# For each date mentioned in qs, sum up the counts for that day
# Note: days may be duplicated
for x in qs:
key = date(x['year'], x['month'], x.get('day', 1))
res.setdefault(key, {label: 0})[label] += x['count']
res[key][label] += x['count']
yield res


Expand Down
2 changes: 0 additions & 2 deletions kitsune/settings_local.py.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import sys

INSTALLED_APPS = list(INSTALLED_APPS)
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
JINGO_EXCLUDE_APPS = list(JINGO_EXCLUDE_APPS)

DEBUG = True
TEMPLATE_DEBUG = DEBUG
SESSION_COOKIE_SECURE = False

# Allows you to run Kitsune without running Celery---all tasks
Expand Down
2 changes: 1 addition & 1 deletion kitsune/sumo/static/sumo/css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body.html-ltr .container_12 {
padding: 0;
width: auto;
}
tap here to go to

div#main-breadcrumbs {
border: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion kitsune/sumo/tests/test_form_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_fr_locale(self):
eq_(u'1\xa0234,567', num)

def test_xx_YY_locale(self):
"""Falls back to English for unknown Django locales"""
"""Falls back to English-like formatting for unknown locales"""
translation.activate('xx-YY')
num = _format_decimal(1234.567)
eq_('1,234.567', num)
Expand Down
2 changes: 0 additions & 2 deletions kitsune/wiki/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1714,8 +1714,6 @@ def test_default_significance(self):
response = get(self.client, 'wiki.review_revision',
args=[self.document.slug, self.revision.id])
eq_(200, response.status_code)
with open('out.html', 'w') as f:
f.write(response.content)
doc = pq(response.content)
eq_(MEDIUM_SIGNIFICANCE,
int(doc('input[name=significance][checked]')[0].attrib['value']))
Expand Down

0 comments on commit cf20db1

Please sign in to comment.