← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:ociproject-picker into launchpad:master

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:ociproject-picker into launchpad:master.

Commit message:
Fixing the usage of OCIProjectName.name index.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

For some reason (was my git push too slow?), the last commit in the previous MP was not included: https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/393627. This MP is just adding back that commit.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:ociproject-picker into launchpad:master.
diff --git a/lib/lp/registry/model/ociproject.py b/lib/lp/registry/model/ociproject.py
index 8e9cd72..3b376be 100644
--- a/lib/lp/registry/model/ociproject.py
+++ b/lib/lp/registry/model/ociproject.py
@@ -308,13 +308,10 @@ class OCIProjectSet:
             OCIProjectName.name.contains_string(name_substring))
 
     def searchByName(self, name_substring):
-        query = IStore(OCIProject).find(
+        return IStore(OCIProject).find(
             OCIProject,
-            OCIProject.ociprojectname == OCIProjectName.id)
-        if name_substring:
-            query = query.find(
-                fti_search(OCIProjectName, name_substring, True))
-        return query
+            OCIProject.ociprojectname == OCIProjectName.id,
+            OCIProjectName.name.contains_string(name_substring))
 
     def preloadDataForOCIProjects(self, oci_projects):
         """See `IOCIProjectSet`."""