~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Curtis Hovey
  • Date: 2011-06-02 21:31:51 UTC
  • mto: This revision was merged to the branch mainline in revision 13177.
  • Revision ID: curtis.hovey@canonical.com-20110602213151-8dw5b6etxjteozvq
Simplified UbuntuSourcePackageNameWidget.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    NotFoundError,
56
56
    UnexpectedFormData,
57
57
    )
 
58
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
58
59
from lp.app.widgets.helpers import get_widget_template
59
60
from lp.app.widgets.itemswidgets import LaunchpadRadioWidget
60
61
from lp.app.widgets.popup import VocabularyPickerWidget
528
529
        return distribution
529
530
 
530
531
 
531
 
class UbuntuSourcePackageNameWidget(
532
 
    BugTaskSourcePackageNameWidget):
533
 
    """Package widget where the distribution can be assumed as Ubuntu
534
 
 
535
 
    This widgets works the same as `BugTaskSourcePackageNameWidget`,
536
 
    except that it assumes the distribution is 'ubuntu'.
537
 
    """
538
 
    distribution_name = "ubuntu"
 
532
class UbuntuSourcePackageNameWidget(BugTaskSourcePackageNameWidget):
 
533
    """A widget to select Ubuntu packages."""
539
534
 
540
535
    def getDistribution(self):
541
536
        """See `BugTaskSourcePackageNameWidget`"""
542
 
        distribution = getUtility(IDistributionSet).getByName(
543
 
            self.distribution_name)
544
 
        if distribution is None:
545
 
            raise UnexpectedFormData(
546
 
                "No such distribution: %s" % self.distribution_name)
547
 
        return distribution
 
537
        return getUtility(ILaunchpadCelebrities).ubuntu
548
538
 
549
539
 
550
540
class AssigneeDisplayWidget(BrowserWidget):