Skip to content

Commit 1ca414d

Browse files
committed
Use f-string instead for string.format
1 parent 723d91e commit 1ca414d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

django_renderpdf/views.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ def render(self, request, template, context) -> HttpResponse:
138138
return HttpResponse(html)
139139
response = HttpResponse(content_type="application/pdf")
140140
if self.prompt_download:
141-
response["Content-Disposition"] = 'attachment; filename="{}"'.format(
142-
self.get_download_name()
143-
)
141+
filename = self.get_download_name()
142+
response["Content-Disposition"] = f'attachment; filename="{filename}"'
144143
helpers.render_pdf(
145144
template=template,
146145
file_=response,

0 commit comments

Comments
 (0)