From 256af802e27eaaafe2e7b6cdb54eb9ee4c9b284e Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 9 May 2022 22:35:46 +1000 Subject: [PATCH] Use the new 'mixin' filter to simplify request of label printer plugins --- InvenTree/templates/js/translated/label.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/InvenTree/templates/js/translated/label.js b/InvenTree/templates/js/translated/label.js index d19c403861..388509c8bf 100644 --- a/InvenTree/templates/js/translated/label.js +++ b/InvenTree/templates/js/translated/label.js @@ -236,17 +236,13 @@ function selectLabel(labels, items, options={}) { if (plugins_enabled) { inventreeGet( `/api/plugin/`, - {}, + { + mixin: 'labels', + }, { async: false, success: function(response) { - response.forEach(function(plugin) { - // Look for active plugins which implement the 'labels' mixin class - if (plugin.active && plugin.mixins && plugin.mixins.labels) { - // This plugin supports label printing - plugins.push(plugin); - } - }); + plugins = response; } } );