From 05a040b4c30ea0d33a5e8327a6b15bec4f677ed9 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Mon, 17 Apr 2023 17:19:09 +0200 Subject: [PATCH] No need to ensure if the distribution is set on `new` action This will be handled by validation on set_distribution action --- app/controllers/spree/admin/orders_controller.rb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/controllers/spree/admin/orders_controller.rb b/app/controllers/spree/admin/orders_controller.rb index e1f22068f3..e6a2355c8a 100644 --- a/app/controllers/spree/admin/orders_controller.rb +++ b/app/controllers/spree/admin/orders_controller.rb @@ -12,8 +12,6 @@ module Spree :invoice, :print, :set_distribution] before_action :load_distribution_choices, only: [:new, :edit, :update, :set_distribution] - # Ensure that the distributor is set for an order when - before_action :ensure_distribution, only: :new before_action :require_distributor_abn, only: :invoice respond_to :html, :json @@ -145,17 +143,6 @@ module Spree ocs.closed + ocs.undated end - - def ensure_distribution - unless @order - @order = Spree::Order.new - @order.generate_order_number - @order.save! - end - return if @order.distribution_set? - - render 'set_distribution', locals: { order: @order } - end end end end