File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,10 @@ def concept_ids_from_es(
361361 search = ConceptDocument .search ()
362362 if source_version :
363363 search = search .filter ('term' , source = source_version .mnemonic .lower ())
364- search = search .filter ('term' , source_version = source_version .version )
364+ if source_version .is_head :
365+ search = search .filter ('term' , is_latest_version = True )
366+ else :
367+ search = search .filter ('term' , source_version = source_version .version )
365368 search = search .filter ('term' , retired = False )
366369
367370 should_queries = [
@@ -505,6 +508,7 @@ async def concepts( # pylint: disable=too-many-arguments,too-many-locals
505508 mapping_prefetch ,
506509 )
507510
511+ serialized = await sync_to_async (serialize_concepts )(concepts )
508512 return ConceptSearchResult (
509513 org = org ,
510514 source = source ,
@@ -513,5 +517,5 @@ async def concepts( # pylint: disable=too-many-arguments,too-many-locals
513517 limit = pagination ['limit' ] if pagination else None ,
514518 total_count = total ,
515519 has_next_page = has_next (total , pagination ),
516- results = serialize_concepts ( concepts ) ,
520+ results = serialized ,
517521 )
You can’t perform that action at this time.
0 commit comments