~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

Merged fix-retest-colorize into redo-read-only-transactions-in-buildmaster, resolving several import conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
from zope.traversing.browser import absoluteURL
121
121
from zope.traversing.interfaces import IPathAdapter
122
122
 
123
 
from canonical.config import config
124
 
from canonical.launchpad import (
125
 
    _,
126
 
    helpers,
127
 
    )
128
 
from lp.services.feeds.browser import (
129
 
    BugTargetLatestBugsFeedLink,
130
 
    FeedsMixin,
131
 
    )
132
 
from lp.bugs.interfaces.bugtracker import IHasExternalBugTracker
133
 
from lp.services.mail.notification import get_unified_diff
134
 
from canonical.launchpad.searchbuilder import (
135
 
    all,
136
 
    any,
137
 
    NULL,
138
 
    )
139
 
from canonical.launchpad.webapp import (
140
 
    canonical_url,
141
 
    enabled_with_permission,
142
 
    GetitemNavigation,
143
 
    LaunchpadView,
144
 
    Link,
145
 
    Navigation,
146
 
    NavigationMenu,
147
 
    redirection,
148
 
    stepthrough,
149
 
    )
150
 
from canonical.launchpad.webapp.authorization import (
151
 
    check_permission,
152
 
    precache_permission_for_objects,
153
 
    )
154
 
from canonical.launchpad.webapp.batching import TableBatchNavigator
155
 
from canonical.launchpad.webapp.breadcrumb import Breadcrumb
156
 
from canonical.launchpad.webapp.interfaces import ILaunchBag
157
 
from canonical.launchpad.webapp.menu import structured
158
 
from canonical.lazr.interfaces import IObjectPrivacy
 
123
from lp import _
159
124
from lp.answers.interfaces.questiontarget import IQuestionTarget
160
125
from lp.app.browser.launchpad import iter_view_registrations
161
126
from lp.app.browser.launchpadform import (
250
215
    UNRESOLVED_BUGTASK_STATUSES,
251
216
    UserCannotEditBugTaskStatus,
252
217
    )
253
 
from lp.bugs.interfaces.bugtracker import BugTrackerType
 
218
from lp.bugs.interfaces.bugtracker import (
 
219
    BugTrackerType,
 
220
    IHasExternalBugTracker,
 
221
    )
254
222
from lp.bugs.interfaces.bugwatch import BugWatchActivityStatus
255
223
from lp.bugs.interfaces.cve import ICveSet
256
224
from lp.bugs.interfaces.malone import IMaloneApplication
276
244
from lp.registry.interfaces.sourcepackage import ISourcePackage
277
245
from lp.registry.model.personroles import PersonRoles
278
246
from lp.registry.vocabularies import MilestoneVocabulary
 
247
from lp.services.config import config
279
248
from lp.services.features import getFeatureFlag
 
249
from lp.services.feeds.browser import (
 
250
    BugTargetLatestBugsFeedLink,
 
251
    FeedsMixin,
 
252
    )
280
253
from lp.services.fields import PersonChoice
 
254
from lp.services.helpers import shortlist
 
255
from lp.services.mail.notification import get_unified_diff
 
256
from lp.services.privacy.interfaces import IObjectPrivacy
281
257
from lp.services.propertycache import (
282
258
    cachedproperty,
283
259
    get_property_cache,
284
260
    )
 
261
from lp.services.searchbuilder import (
 
262
    all,
 
263
    any,
 
264
    NULL,
 
265
    )
285
266
from lp.services.utils import obfuscate_structure
 
267
from lp.services.webapp import (
 
268
    canonical_url,
 
269
    enabled_with_permission,
 
270
    GetitemNavigation,
 
271
    LaunchpadView,
 
272
    Link,
 
273
    Navigation,
 
274
    NavigationMenu,
 
275
    redirection,
 
276
    stepthrough,
 
277
    )
 
278
from lp.services.webapp.authorization import (
 
279
    check_permission,
 
280
    precache_permission_for_objects,
 
281
    )
 
282
from lp.services.webapp.batching import TableBatchNavigator
 
283
from lp.services.webapp.breadcrumb import Breadcrumb
 
284
from lp.services.webapp.interfaces import ILaunchBag
 
285
from lp.services.webapp.menu import structured
286
286
 
287
287
 
288
288
vocabulary_registry = getVocabularyRegistry()
420
420
def get_sortorder_from_request(request):
421
421
    """Get the sortorder from the request.
422
422
 
423
 
    >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
 
423
    >>> from lp.services.webapp.servers import LaunchpadTestRequest
424
424
    >>> get_sortorder_from_request(LaunchpadTestRequest(form={}))
425
425
    ['-importance']
426
426
    >>> get_sortorder_from_request(
3071
3071
                dict(
3072
3072
                    value=term.token, title=term.title or term.token,
3073
3073
                    checked=term.value in default_values))
3074
 
        return helpers.shortlist(widget_values, longest_expected=12)
 
3074
        return shortlist(widget_values, longest_expected=12)
3075
3075
 
3076
3076
    def getStatusWidgetValues(self):
3077
3077
        """Return data used to render the status checkboxes."""