Comment 2 for bug 666496

Revision history for this message
Brian Murray (brian-murray) wrote :

I think this occurs because the exact same bug task is excluded but we are returning bugs and not bug tasks, so if you have a bug with multiple tasks one of the additional tasks will be returned.

From lib/lp/bugs/model/bugtask.py:

        matching_bugtasks = [
            bug_task for bug_task in matching_bugtasks[:4*limit]
            if bug_task != self]

        matching_bugs = getUtility(IBugSet).getDistinctBugsForBugTasks(
            matching_bugtasks, user, limit)
        return matching_bugs

So 'if bug_task.bug.id != self.bug.id' would likely resolve this.