mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Catch TemplateDoesNotExist error (#4518)
This commit is contained in:
		| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user