mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix for label printing plugins (#5371)
- Don't pass pdf_file data to background process - pre-rendered template data cannot be pickled
This commit is contained in:
parent
b89a120f9e
commit
36d669d70d
@ -116,6 +116,8 @@ class LabelPrintingMixin:
|
||||
self.print_label(**print_args)
|
||||
else:
|
||||
# Non-blocking print job
|
||||
|
||||
# Offload the print job to a background worker
|
||||
self.offload_label(**print_args)
|
||||
|
||||
# Return a JSON response to the user
|
||||
@ -151,6 +153,9 @@ class LabelPrintingMixin:
|
||||
Offloads a call to the 'print_label' method (of this plugin) to a background worker.
|
||||
"""
|
||||
|
||||
# Exclude the 'pdf_file' object - cannot be pickled
|
||||
kwargs.pop('pdf_file', None)
|
||||
|
||||
offload_task(
|
||||
plugin_label.print_label,
|
||||
self.plugin_slug(),
|
||||
|
Loading…
Reference in New Issue
Block a user