~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Colin Watson
  • Date: 2011-08-19 00:25:11 UTC
  • mfrom: (7675.1045.728 db-devel)
  • mto: This revision was merged to the branch mainline in revision 13909.
  • Revision ID: cjwatson@canonical.com-20110819002511-0x8hrqs1ckiqk53g
merge db-devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
59
59
from lp.app.widgets.helpers import get_widget_template
60
60
from lp.app.widgets.itemswidgets import LaunchpadRadioWidget
61
 
from lp.app.widgets.popup import VocabularyPickerWidget
 
61
from lp.app.widgets.popup import (
 
62
    PersonPickerWidget,
 
63
    VocabularyPickerWidget,
 
64
    )
62
65
from lp.app.widgets.textwidgets import (
63
66
    StrippedTextWidget,
64
67
    URIWidget,
69
72
    UnrecognizedBugTrackerURL,
70
73
    )
71
74
from lp.registry.interfaces.distribution import IDistributionSet
 
75
from lp.services.features import getFeatureFlag
72
76
from lp.services.fields import URIField
73
77
 
74
78
 
90
94
        #
91
95
        # See zope.app.form.interfaces.IInputWidget.
92
96
        self.required = False
93
 
        self.assignee_chooser_widget = VocabularyPickerWidget(
 
97
        self.assignee_chooser_widget = PersonPickerWidget(
94
98
            context, context.vocabulary, request)
95
99
        self.setUpNames()
96
100
 
495
499
 
496
500
        distribution = self.getDistribution()
497
501
 
 
502
        if bool(getFeatureFlag('disclosure.dsp_picker.enabled')):
 
503
            try:
 
504
                source = self.context.vocabulary.getTermByToken(input).value
 
505
            except NotFoundError:
 
506
                raise ConversionError(
 
507
                    "Launchpad doesn't know of any source package named"
 
508
                    " '%s' in %s." % (input, distribution.displayname))
 
509
            else:
 
510
                return source
 
511
        # Else the untrusted SPN vocab was used so it needs seconday
 
512
        # verification.
498
513
        try:
499
514
            source = distribution.guessPublishedSourcePackageName(input)
500
515
        except NotFoundError: