🚨(backend) fix Django deprecation warning for format_html
Resolved RemovedInDjango60Warning by ensuring format_html() is called with required arguments, addressing compatibility with Django 6.0. /!\ Fix by Claude, need real-world testing. Linterand tests pass.
This commit is contained in:
@@ -761,7 +761,7 @@ class Template(BaseModel):
|
||||
"""
|
||||
document_html = weasyprint.HTML(
|
||||
string=DjangoTemplate(self.code).render(
|
||||
Context({"body": html.format_html(body_html), **metadata})
|
||||
Context({"body": html.format_html("{}", body_html), **metadata})
|
||||
)
|
||||
)
|
||||
css = weasyprint.CSS(
|
||||
@@ -780,7 +780,7 @@ class Template(BaseModel):
|
||||
Generate and return a docx document wrapped around the current template
|
||||
"""
|
||||
template_string = DjangoTemplate(self.code).render(
|
||||
Context({"body": html.format_html(body_html), **metadata})
|
||||
Context({"body": html.format_html("{}", body_html), **metadata})
|
||||
)
|
||||
|
||||
html_string = f"""
|
||||
|
||||
Reference in New Issue
Block a user