       authorise_api_reponse = ""
       dataFetcher("/api/users/authorise_api?token=" + spree_api_key).then (data) ->
         authorise_api_reponse = data
-        $scope.spree_api_key_ok = data.hasOwnProperty("success") and data["success"] is "Use of API Authorised"
+        $scope.spree_api_key_ok = data.hasOwnProperty("success") and data["success"] == "Use of API Authorised"
         if $scope.spree_api_key_ok
           $http.defaults.headers.common["X-Spree-Token"] = spree_api_key
           dataFetcher("/api/enterprises/managed?template=bulk_index&q[is_primary_producer_eq]=true").then (data) ->

        url: "/admin/products/bulk_update"
        data: productsToSubmit
      ).success((data) ->
        if angular.toJson($scope.products) is angular.toJson(data)
          $scope.resetProducts data
          $scope.displaySuccess()
        else



    $scope.editWarn = (product, variant) ->
      if ($scope.dirtyProductCount() > 0 and confirm("Unsaved changes will be lost. Continue anyway?")) or ($scope.dirtyProductCount() == 0)
        window.location = "/admin/products/" + product.permalink_live + ((if variant then "/variants/" + variant.id else "")) + "/edit"


    $scope.deleteProduct = (product) ->
