[UPDT] BASE: Generate payslip method

This commit is contained in:
Horilla
2023-12-19 15:12:37 +05:30
parent ee4ef5369d
commit 067fc10c2d

View File

@@ -460,6 +460,6 @@ def generate_pdf(template_path, context):
response = HttpResponse(result.getvalue(), content_type="application/pdf")
response[
"Content-Disposition"
] = f'''attachment;filename="{context["employee"]}'s payslip for {context["range"]}.pdf"'''
] = f'''attachment;filename="{context.get("employee")}'s payslip for {context.get("range")}.pdf"'''
return response
return None