summaryrefslogtreecommitdiffstats
path: root/askbot/models/question.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-16 22:11:16 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-16 22:11:16 -0400
commit5ea0e8458e93483347c4db08166ed5e6cd9e34f8 (patch)
tree49cc1e34b7983605c90ddee51e214464a26a53dc /askbot/models/question.py
parent547f8c19aaa41199624ff59c89c86cfd1293945b (diff)
downloadaskbot-5ea0e8458e93483347c4db08166ed5e6cd9e34f8.tar.gz
askbot-5ea0e8458e93483347c4db08166ed5e6cd9e34f8.tar.bz2
askbot-5ea0e8458e93483347c4db08166ed5e6cd9e34f8.zip
factored out the name prefix for the personal groups to just one place
Diffstat (limited to 'askbot/models/question.py')
-rw-r--r--askbot/models/question.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/askbot/models/question.py b/askbot/models/question.py
index 98a38c90..a4b3233a 100644
--- a/askbot/models/question.py
+++ b/askbot/models/question.py
@@ -25,7 +25,7 @@ from askbot.models.base import DraftContent, BaseQuerySetManager
from askbot.models.tag import Tag, get_groups
from askbot.models.post import Post, PostRevision
from askbot.models.post import PostToGroup
-from askbot.models.user import Group
+from askbot.models.user import Group, PERSONAL_GROUP_NAME_PREFIX
from askbot.models import signals
from askbot import const
from askbot.utils.lists import LazyList
@@ -540,8 +540,8 @@ class Thread(models.Model):
exclude_user=visitor
)
groups = self.groups
- ugroups = groups.filter(name__startswith='_internal_')
- ggroups = groups.exclude(name__startswith='_internal_')
+ ugroups = groups.get_personal()
+ ggroups = groups.exclude_personal()
sharing_info = {
'users': shared_users,
@@ -559,7 +559,7 @@ class Thread(models.Model):
thread=self,
visibility=ThreadToGroup.SHOW_ALL_RESPONSES
) & models.Q(
- group__name__startswith='_internal_'
+ group__name__startswith=PERSONAL_GROUP_NAME_PREFIX
)
if exclude_user:
@@ -585,13 +585,13 @@ class Thread(models.Model):
def get_groups_shared_with(self, max_count=None):
"""returns query set of groups with whom thread is shared"""
thread_groups = ThreadToGroup.objects.filter(
- models.Q(
- thread=self,
- visibility=ThreadToGroup.SHOW_ALL_RESPONSES
- ) & ~models.Q(
- group__name__startswith='_internal_'
- )
- )
+ models.Q(
+ thread=self,
+ visibility=ThreadToGroup.SHOW_ALL_RESPONSES
+ ) & ~models.Q(
+ group__name__startswith=PERSONAL_GROUP_NAME_PREFIX
+ )
+ )
if max_count:
thread_groups = thread_groups[:max_count]