From ee33de711a48551e41fdccd317d6d8ce63fc3477 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 19 Aug 2021 23:36:54 +0200 Subject: [PATCH 1/2] move translation stats into own task --- tasks.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tasks.py b/tasks.py index 7ebdd17480..92003fe809 100644 --- a/tasks.py +++ b/tasks.py @@ -173,7 +173,18 @@ def static(c): manage(c, "collectstatic --no-input") -@task(post=[static]) +@task +def translate_stats(c): + """ + Collect translation stats. + The file generated from this is needed for the UI. + """ + + path = os.path.join('InvenTree', 'script', 'translation_stats.py') + c.run(f'python3 {path}') + + +@task(post=[translate_stats, static]) def translate(c): """ Regenerate translation files. @@ -186,12 +197,8 @@ def translate(c): manage(c, "makemessages --all -e py,html,js --no-wrap") manage(c, "compilemessages") - path = os.path.join('InvenTree', 'script', 'translation_stats.py') - c.run(f'python3 {path}') - - -@task(pre=[install, migrate, translate, clean_settings]) +@task(pre=[install, migrate, translate_stats, clean_settings]) def update(c): """ Update InvenTree installation. @@ -203,7 +210,7 @@ def update(c): - install - migrate - - translate + - translate_stats - clean_settings """ pass From 575cf87b98c58a89e3677e07990fa4341de3f927 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 19 Aug 2021 23:37:38 +0200 Subject: [PATCH 2/2] also run static on update --- tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 92003fe809..3de0241c07 100644 --- a/tasks.py +++ b/tasks.py @@ -198,7 +198,7 @@ def translate(c): manage(c, "compilemessages") -@task(pre=[install, migrate, translate_stats, clean_settings]) +@task(pre=[install, migrate, translate_stats, static, clean_settings]) def update(c): """ Update InvenTree installation. @@ -211,6 +211,7 @@ def update(c): - install - migrate - translate_stats + - static - clean_settings """ pass