mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Catch TemplateDoesNotExist error (#4518)
This commit is contained in:
parent
73aa56c6f3
commit
4e72ac303f
@ -295,8 +295,11 @@ class StockItemTestReportPrint(StockItemTestReportMixin, ReportPrintMixin, Retri
|
||||
if common.models.InvenTreeSetting.get_setting('REPORT_ATTACH_TEST_REPORT', cache=False):
|
||||
|
||||
# Construct a PDF file object
|
||||
pdf = report.get_document().write_pdf()
|
||||
pdf_content = ContentFile(pdf, "test_report.pdf")
|
||||
try:
|
||||
pdf = report.get_document().write_pdf()
|
||||
pdf_content = ContentFile(pdf, "test_report.pdf")
|
||||
except TemplateDoesNotExist:
|
||||
return
|
||||
|
||||
StockItemAttachment.objects.create(
|
||||
attachment=pdf_content,
|
||||
|
Loading…
Reference in New Issue
Block a user