~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-23 13:25:35 UTC
  • mfrom: (14012.1.13 valid-targets-0)
  • Revision ID: launchpad@pqm.canonical.com-20110923132535-5rq8hxf1qtfgr7w2
[r=jcsackett][bug=828838] Restrict the target widget to pillars that
 use Launchpad.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    "BugTaskAssigneeWidget",
11
11
    "BugTaskBugWatchWidget",
12
12
    "BugTaskSourcePackageNameWidget",
 
13
    "BugTaskTargetWidget",
13
14
    "BugWatchEditForm",
14
15
    "DBItemDisplayWidget",
15
16
    "NewLineToSpacesWidget",
66
67
    StrippedTextWidget,
67
68
    URIWidget,
68
69
    )
 
70
from lp.app.widgets.launchpadtarget import LaunchpadTargetWidget
69
71
from lp.bugs.interfaces.bugwatch import (
70
72
    IBugWatchSet,
71
73
    NoBugTrackerFound,
72
74
    UnrecognizedBugTrackerURL,
73
75
    )
 
76
from lp.bugs.vocabulary import UsesBugsDistributionVocabulary
74
77
from lp.registry.interfaces.distribution import IDistributionSet
75
78
from lp.services.features import getFeatureFlag
76
79
from lp.services.fields import URIField
473
476
            contents='\n'.join(rendered_items))
474
477
 
475
478
 
 
479
class BugTaskTargetWidget(LaunchpadTargetWidget):
 
480
 
 
481
    def getDistributionVocabulary(self):
 
482
        distro = self.context.context.distribution
 
483
        vocabulary = UsesBugsDistributionVocabulary(distro)
 
484
        return vocabulary
 
485
 
 
486
 
476
487
class BugTaskSourcePackageNameWidget(VocabularyPickerWidget):
477
488
    """A widget for associating a bugtask with a SourcePackageName.
478
489