Commit b29de602131109186fcb66ec66fbc392f44de47e

Authored by Sergio Oliveira
1 parent 3176f1f7

Adding attachments to chart

src/accounts/views.py
@@ -61,7 +61,7 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): @@ -61,7 +61,7 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
61 ) 61 )
62 62
63 63
64 - for type in ['thread', 'ticket', 'wiki', 'changeset']: 64 + for type in ['thread', 'ticket', 'wiki', 'changeset', 'attachment']:
65 sqs = SearchQuerySet().filter( 65 sqs = SearchQuerySet().filter(
66 type=type, 66 type=type,
67 modified__gte=six_months, 67 modified__gte=six_months,
src/home/views.py
@@ -17,7 +17,7 @@ def index(request): @@ -17,7 +17,7 @@ def index(request):
17 17
18 count_types = OrderedDict() 18 count_types = OrderedDict()
19 six_months = timezone.now() - timezone.timedelta(days=180) 19 six_months = timezone.now() - timezone.timedelta(days=180)
20 - for type in ['thread', 'ticket', 'wiki', 'changeset']: 20 + for type in ['thread', 'ticket', 'wiki', 'changeset', 'attachment']:
21 count_types[trans(type)] = SearchQuerySet().filter( 21 count_types[trans(type)] = SearchQuerySet().filter(
22 type=type, 22 type=type,
23 modified__gte=six_months, 23 modified__gte=six_months,
src/search/utils.py
@@ -8,6 +8,7 @@ def trans(key): @@ -8,6 +8,7 @@ def trans(key):
8 'thread': _('Emails'), 8 'thread': _('Emails'),
9 'changeset': _('Code'), 9 'changeset': _('Code'),
10 'ticket': _('Tickets'), 10 'ticket': _('Tickets'),
  11 + 'attachment': _('Attachments'),
11 } 12 }
12 13
13 return translations.get(key, key) 14 return translations.get(key, key)