@@ -228,11 +228,7 @@ def _get_all_projects_data(self):
228
228
)
229
229
230
230
# Fallback to the default version of the subproject.
231
- if (
232
- not version
233
- and main_project .has_feature (Feature .SEARCH_SUBPROJECTS_ON_DEFAULT_VERSION )
234
- and subproject .default_version
235
- ):
231
+ if not version and subproject .default_version :
236
232
version = self ._get_subproject_version (
237
233
version_slug = subproject .default_version ,
238
234
subproject = subproject ,
@@ -307,35 +303,21 @@ def get_queryset(self):
307
303
main_project = self ._get_project ()
308
304
main_version = self ._get_version ()
309
305
projects = {}
310
- filters = {}
311
-
312
- if main_project .has_feature (Feature .SEARCH_SUBPROJECTS_ON_DEFAULT_VERSION ):
313
- projects = {
314
- project : project_data .version .slug
315
- for project , project_data in self ._get_all_projects_data ().items ()
316
- }
317
- # Check to avoid searching all projects in case it's empty.
318
- if not projects :
319
- log .info ('Unable to find a version to search' )
320
- return []
321
- else :
322
- filters ['project' ] = list (self ._get_all_projects_data ().keys ())
323
- filters ['version' ] = main_version .slug
324
- # Check to avoid searching all projects in case these filters are empty.
325
- if not filters ['project' ]:
326
- log .info ('Unable to find a project to search' )
327
- return []
328
- if not filters ['version' ]:
329
- log .info ('Unable to find a version to search' )
330
- return []
306
+
307
+ projects = {
308
+ project : project_data .version .slug
309
+ for project , project_data in self ._get_all_projects_data ().items ()
310
+ }
311
+ # Check to avoid searching all projects in case it's empty.
312
+ if not projects :
313
+ log .info ('Unable to find a version to search' )
314
+ return []
331
315
332
316
query = self .request .query_params ['q' ]
333
317
queryset = PageSearch (
334
318
query = query ,
335
319
projects = projects ,
336
- filters = filters ,
337
- user = self .request .user ,
338
- # We use a permission class to control authorization
320
+ # We use a permission class to control authorization.
339
321
filter_by_user = False ,
340
322
use_advanced_query = not main_project .has_feature (Feature .DEFAULT_TO_FUZZY_SEARCH ),
341
323
)
0 commit comments