~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/widgets/launchpadtarget.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-01 14:54:33 UTC
  • mfrom: (14400.2.27 dsp-vocab-unknown-distro)
  • Revision ID: launchpad@pqm.canonical.com-20111201145433-u5ahqdo1rl9mkybh
[r=abentley][bug=889192] DSP vocabulary must handle the case where
 the distribution is not yet known.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
                    " Launchpad" % entered_name)
136
136
 
137
137
            if self.package_widget.hasInput():
 
138
                if bool(getFeatureFlag('disclosure.dsp_picker.enabled')):
 
139
                    self.package_widget.vocabulary.setDistribution(
 
140
                        distribution)
138
141
                try:
139
142
                    package_name = self.package_widget.getInputValue()
140
143
                except ConversionError:
146
149
                if package_name is None:
147
150
                    return distribution
148
151
                try:
149
 
                    if bool(getFeatureFlag('disclosure.dsp_picker.enabled')):
150
 
                        vocab = self.package_widget.context.vocabulary
151
 
                        name = package_name.name
152
 
                        dsp = vocab.getTermByToken(name).value
 
152
                    if IDistributionSourcePackage.providedBy(package_name):
 
153
                        dsp = package_name
153
154
                    else:
154
155
                        source_name = (
155
156
                            distribution.guessPublishedSourcePackageName(