diff --git a/tailbone/templates/labels/profiles/printer.mako b/tailbone/templates/labels/profiles/printer.mako
index 3fe1089f..3863f3ab 100644
--- a/tailbone/templates/labels/profiles/printer.mako
+++ b/tailbone/templates/labels/profiles/printer.mako
@@ -28,6 +28,7 @@
${h.form(request.current_route_url())}
+ ${h.csrf_token(request)}
% for name, display in printer.required_settings.iteritems():
diff --git a/tailbone/templates/products/index.mako b/tailbone/templates/products/index.mako
index eb24cc96..28ea4ca2 100644
--- a/tailbone/templates/products/index.mako
+++ b/tailbone/templates/products/index.mako
@@ -44,6 +44,7 @@
$('.newgrid-wrapper .grid-header .tools select').selectmenu();
$('.newgrid-wrapper').on('click', 'a.print_label', function() {
+ var tr = $(this).parents('tr:first');
var quantity = $('table.label-printing #label-quantity');
if (isNaN(quantity.val())) {
alert("You must provide a valid label quantity.");
@@ -52,11 +53,10 @@
} else {
quantity = quantity.val();
var data = {
- product: get_uuid(this),
+ product: tr.data('uuid'),
profile: $('#label-profile').val(),
quantity: quantity
};
- console.log(data);
$.get('${url('products.print_labels')}', data, function(data) {
if (data.error) {
alert("An error occurred while attempting to print:\n\n" + data.error);