~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/bugtask.py

MergeĀ fromĀ devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
from canonical.launchpad.components.decoratedresultset import (
79
79
    DecoratedResultSet,
80
80
    )
81
 
from canonical.launchpad.interfaces.launchpad import (
82
 
    IPersonRoles,
83
 
    )
84
81
from canonical.launchpad.helpers import shortlist
85
82
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
86
83
from canonical.launchpad.interfaces.lpstorm import IStore
166
163
from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
167
164
from lp.registry.model.pillar import pillar_sort_key
168
165
from lp.registry.model.sourcepackagename import SourcePackageName
 
166
from lp.services import features
169
167
from lp.services.propertycache import get_property_cache
170
168
from lp.soyuz.enums import PackagePublishingStatus
171
169
from lp.soyuz.model.publishing import SourcePackagePublishingHistory
1778
1776
        if params.status is not None:
1779
1777
            extra_clauses.append(self._buildStatusClause(params.status))
1780
1778
 
1781
 
        if params.user is not None:
1782
 
            user_roles = IPersonRoles(params.user)
1783
 
            if not user_roles.in_registry_experts:
1784
 
                extra_clauses.append(
1785
 
                    """NOT EXISTS (SELECT TRUE
1786
 
                                FROM Product
1787
 
                                WHERE Product.id = BugTask.product
1788
 
                                AND Product.active = False)""")
1789
 
 
1790
1779
        if params.milestone:
1791
1780
            if IProjectGroupMilestone.providedBy(params.milestone):
1792
1781
                where_cond = """
2217
2206
                AND MessageChunk.fti @@ ftq(%s))""" % searchtext_quoted
2218
2207
        text_search_clauses = [
2219
2208
            "Bug.fti @@ ftq(%s)" % searchtext_quoted,
2220
 
            "BugTask.fti @@ ftq(%s)" % searchtext_quoted,
2221
 
            "BugTask.targetnamecache ILIKE '%%' || %s || '%%'" % (
2222
 
                searchtext_like_quoted)]
 
2209
            "BugTask.fti @@ ftq(%s)" % searchtext_quoted
 
2210
            ]
 
2211
        no_targetnamesearch = bool(features.getFeatureFlag(
 
2212
            'malone.disable_targetnamesearch'))
 
2213
        if not no_targetnamesearch:
 
2214
            text_search_clauses.append(
 
2215
                "BugTask.targetnamecache ILIKE '%%' || %s || '%%'" % (
 
2216
                searchtext_like_quoted))
2223
2217
        # Due to performance problems, whether to search in comments is
2224
2218
        # controlled by a config option.
2225
2219
        if config.malone.search_comments: