Compare commits

..

No commits in common. "ba1e5cd04c1c65937d959472635bd48a78d92bcb" and "76fe8db619b273d5c42346dc76f5bd48e153a1dd" have entirely different histories.

2 changed files with 1 additions and 20 deletions

View File

@ -121,17 +121,8 @@ class ModuleSeeder:
from {self._schema}.content_items ci from {self._schema}.content_items ci
join {self._schema}.attribute_definition_sets ads join {self._schema}.attribute_definition_sets ads
on ads.id = ci.attribute_definition_set_id on ads.id = ci.attribute_definition_set_id
left join {self._schema}.content_attributes ca
on ca.content_id = ci.id
and ca.attribute_definition_id = (
select id
from {self._schema}.attribute_definitions
where attribute_definition_set_id = ads.id
and code = 'sort_order'
limit 1
)
where ads.code = :definition_set_code where ads.code = :definition_set_code
order by ca.value_number asc nulls last, ci.sort_title asc, ci.id asc order by ci.sort_title asc, ci.id asc
"""), """),
{"definition_set_code": definition_set_code}, {"definition_set_code": definition_set_code},
) )

View File

@ -300,16 +300,6 @@ class SeedOrchestrator:
# seeded by this invocation are candidates for module # seeded by this invocation are candidates for module
# association. Never rewrite unrelated template rows. # association. Never rewrite unrelated template rows.
content_ids = [result.content_id for result in batch.results] content_ids = [result.content_id for result in batch.results]
elif batch.results:
# Preserve authored sequence from the source document.
content_ids = [result.content_id for result in batch.results]
known_ids = set(content_ids)
all_ids = await self._modules.resolve_content_ids_for_definition_set(
definition_set_code=mapping.code
)
for remaining_id in all_ids:
if remaining_id not in known_ids:
content_ids.append(remaining_id)
else: else:
content_ids = await self._modules.resolve_content_ids_for_definition_set( content_ids = await self._modules.resolve_content_ids_for_definition_set(
definition_set_code=mapping.code definition_set_code=mapping.code