Skip to content

Commit

Permalink
Merge pull request #164 from colab/Fix_collaboration_count
Browse files Browse the repository at this point in the history
Fix collaboration graph count
  • Loading branch information
GustJc committed Mar 24, 2016
2 parents 2f94518 + aee40e0 commit e55b356
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 4 additions & 5 deletions colab/plugins/utils/collaborations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from django.conf import settings

from colab.plugins.utils.models import Collaboration
from colab.super_archives.utils.collaborations import (get_visible_threads,
count_threads)
from colab.super_archives.utils.collaborations import (get_visible_threads)


def get_collaboration_data(logged_user, filter_by_user=None):
Expand All @@ -20,13 +19,13 @@ def get_collaboration_data(logged_user, filter_by_user=None):
latest_results = []
populate_count_types = False

messages = get_visible_threads(logged_user, filter_by_user)

if count_types is None:
populate_count_types = True
count_types = OrderedDict()

count_types[_('Emails')] = count_threads()

messages = get_visible_threads(logged_user, filter_by_user)
count_types[_('Emails')] = len(messages)

latest_results.extend(messages)

Expand Down
12 changes: 12 additions & 0 deletions colab/super_archives/tests/test_utils_collaborations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding:utf-8 -*-

from django.test import TestCase
from colab.super_archives.utils.collaborations import count_threads


class CollaborationTest(TestCase):

fixtures = ['mailinglistdata.json']

def test_count_threads(self):
self.assertEquals(count_threads(), 5)

0 comments on commit e55b356

Please sign in to comment.