~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/browser/vocabulary.py

  • Committer: Jelmer Vernooij
  • Date: 2011-08-22 21:04:00 UTC
  • mfrom: (13261.7.21 bzr-2.4b4)
  • mto: This revision was merged to the branch mainline in revision 13941.
  • Revision ID: jelmer@canonical.com-20110822210400-3hfq31q2wgrtauad
Merge bzr-2.4b4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
 
147
147
        personpicker_affiliation_enabled = kwarg.get(
148
148
                                    'personpicker_affiliation_enabled', False)
149
 
        if personpicker_affiliation_enabled:
 
149
        affiliated_context = IHasAffiliation(context_object, None)
 
150
        if (affiliated_context is not None
 
151
            and personpicker_affiliation_enabled):
150
152
            # If a person is affiliated with the associated_object then we
151
153
            # can display a badge.
152
 
            badges = IHasAffiliation(
153
 
                context_object).getAffiliationBadges(term_values)
 
154
            badges = affiliated_context.getAffiliationBadges(term_values)
154
155
            for picker_entry, badges in izip(picker_entries, badges):
155
156
                picker_entry.badges = []
156
157
                for badge_info in badges:
280
281
        search_text = self.request.form.get('search_text')
281
282
        if search_text is None:
282
283
            raise MissingInputError('search_text', '')
 
284
        search_filter = self.request.form.get('search_filter')
283
285
 
284
286
        try:
285
287
            factory = getUtility(IVocabularyFactory, name)
290
292
        vocabulary = factory(self.context)
291
293
 
292
294
        if IHugeVocabulary.providedBy(vocabulary):
293
 
            matches = vocabulary.searchForTerms(search_text)
 
295
            matches = vocabulary.searchForTerms(search_text, search_filter)
294
296
            total_size = matches.count()
295
297
        else:
296
298
            matches = list(vocabulary)