~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/vocabularies.py

Fix parent candidates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1561
1561
        where = []
1562
1562
        if query is not None:
1563
1563
            term = '%' + query.lower() + '%'
1564
 
            where.append(
1565
 
                Or(
 
1564
            search = Or(
1566
1565
                    DistroSeries.title.lower().like(term),
1567
1566
                    DistroSeries.description.lower().like(term),
1568
 
                    DistroSeries.summary.lower().like(term)))
 
1567
                    DistroSeries.summary.lower().like(term))
 
1568
            where.append(search)
1569
1569
        parent_distributions = Select(
1570
1570
            parent.distributionID, And(
1571
1571
                parent.distributionID != self.distribution.id,
1575
1575
            DistroSeries.distributionID.is_in(parent_distributions))
1576
1576
        terms = self.find_terms(where)
1577
1577
        if len(terms) == 0:
 
1578
            where = [search]
1578
1579
            where.append(DistroSeries.distribution != self.distribution)
1579
1580
            terms = self.find_terms(where)
1580
1581
        return terms