Commit 0763e223ba3aba1d2e8baa61fb9775af2f0c48c0

Authored by Gust
Committed by Sergio Oliveira
1 parent 1627b4a6

Remove duplicated call to mailinglist data

Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Showing 1 changed file with 2 additions and 5 deletions   Show diff stats
colab/accounts/views.py
@@ -81,13 +81,10 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): @@ -81,13 +81,10 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
81 context['results'] = collaborations[:10] 81 context['results'] = collaborations[:10]
82 82
83 query = get_visible_threads(logged_user, profile_user) 83 query = get_visible_threads(logged_user, profile_user)
84 - query = query.order_by('-received_time')  
85 - context['emails'] = query[:10]  
86 -  
87 - messages = get_visible_threads(logged_user, profile_user) 84 + context['emails'] = query.order_by('-received_time')[:10]
88 85
89 count_by = 'thread__mailinglist__name' 86 count_by = 'thread__mailinglist__name'
90 - context['list_activity'] = dict(messages.values_list(count_by) 87 + context['list_activity'] = dict(query.values_list(count_by)
91 .annotate(Count(count_by)) 88 .annotate(Count(count_by))
92 .order_by(count_by)) 89 .order_by(count_by))
93 90