fixing migration

This commit is contained in:
Zach Flanders 2023-04-25 21:05:11 -05:00
parent f43d7f8c70
commit 858a93e98a

View file

@ -16,7 +16,10 @@ def populate_sort_title(apps, schema_editor):
) )
for edition in editions_wo_sort_title: for edition in editions_wo_sort_title:
articles = chain( articles = chain(
*(LANGUAGE_ARTICLES.get(language, ()) for language in edition.languages) *(
LANGUAGE_ARTICLES.get(language, ())
for language in tuple(edition.languages)
)
) )
edition.sort_title = re.sub( edition.sort_title = re.sub(
f'^{" |^".join(articles)} ', "", str(edition.title).lower() f'^{" |^".join(articles)} ', "", str(edition.title).lower()