Add missing return in helper method

This commit is contained in:
Ramon Wenger 2023-08-30 20:56:15 +02:00
parent 569f8a3823
commit f660d45349
1 changed files with 3 additions and 0 deletions

View File

@ -18,9 +18,11 @@ class ModuleDoesNotExistException(Exception):
def translate_page(page: Page, locale: Locale): def translate_page(page: Page, locale: Locale):
logger.debug(f"translating page {page} for locale {locale}")
translated_page = page.copy_for_translation(locale) translated_page = page.copy_for_translation(locale)
revision = translated_page.latest_revision revision = translated_page.latest_revision
translated_page.publish(revision) translated_page.publish(revision)
return translated_page
# todo: make this a django command # todo: make this a django command
@ -73,6 +75,7 @@ def convert_page_to_translation(slug: str, original_slug: str, language_code="en
content_block.locale = locale content_block.locale = locale
content_block.save() content_block.save()
logger.debug(f"moving {module} to {translated_topic}")
module.move(translated_topic, "last-child") module.move(translated_topic, "last-child")
return f"Converted page {slug} to be the {language_code} translation of {original_slug}" return f"Converted page {slug} to be the {language_code} translation of {original_slug}"