← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-optimize-person-visible-specifications into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-optimize-person-visible-specifications into launchpad:master.

Commit message:
Fix search for specifications to which a person is subscribed

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/439512

Commit 938ecc82608559c3523846bfd3b3e53c98eb4881 broke a couple of tests, because `[Or()]` looks truthy as far as `search_specifications` is concerned but we don't want to include it in a query.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-optimize-person-visible-specifications into launchpad:master.
diff --git a/lib/lp/registry/model/person.py b/lib/lp/registry/model/person.py
index 5c02c46..526aa12 100644
--- a/lib/lp/registry/model/person.py
+++ b/lib/lp/registry/model/person.py
@@ -887,7 +887,7 @@ class Person(
                 )
             )
 
-        clauses = [Or(*role_clauses)]
+        clauses = [Or(*role_clauses)] if role_clauses else None
         if SpecificationFilter.COMPLETE not in filter:
             if (
                 in_progress