diff --git a/weblate_web/legal/management/commands/generate_terms.py b/weblate_web/legal/management/commands/generate_terms.py index f7afbd13f..3ac2ba3f9 100644 --- a/weblate_web/legal/management/commands/generate_terms.py +++ b/weblate_web/legal/management/commands/generate_terms.py @@ -27,6 +27,8 @@ HOSTED_ACCOUNT = "Hosted Weblate account" OUT_DIR = Path(__file__).parent.parent.parent / "static" +GTC_NAME = "Weblate_General_Terms_and_Conditions.pdf" +PRIVACY_NAME = "Weblate_Privacy_Policy.pdf" class Command(BaseCommand): @@ -36,12 +38,22 @@ class Command(BaseCommand): def handle(self, *args, **options): render_pdf( html=render_to_string( - "pdf/terms.html", {"title": "General Terms and Conditions"} + "pdf/terms.html", + { + "title": "General Terms and Conditions", + "privacy_url": f"https://weblate.org/static/{PRIVACY_NAME}", + }, ), - output=OUT_DIR / "Weblate_General_Terms_and_Conditions.pdf", + output=OUT_DIR / GTC_NAME, ) render_pdf( - html=render_to_string("pdf/privacy.html", {"title": "Privacy Policy"}), - output=OUT_DIR / "Weblate_Privacy_Policy.pdf", + html=render_to_string( + "pdf/privacy.html", + { + "title": "Privacy Policy", + "terms_url": f"https://weblate.org/static/{GTC_NAME}", + }, + ), + output=OUT_DIR / PRIVACY_NAME, )