2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Send notification if printing fails

If label printing fails (due to a plugin error) then the user is notified.
This commit is contained in:
Oliver
2022-03-25 15:57:32 +11:00
parent 5921964fdb
commit c1b408f8a3
3 changed files with 30 additions and 4 deletions

View File

@ -138,6 +138,9 @@ class LabelPrintMixin:
"""
# Label instance
label_instance = self.get_object()
for output in outputs:
"""
For each output, we generate a temporary image file,
@ -156,7 +159,9 @@ class LabelPrintMixin:
offload_task(
'plugin.events.print_label',
plugin.plugin_slug(),
image
image,
label_instance=label_instance,
user=request.user,
)
return JsonResponse({