check if invoices feature is enabled for the current user before printing a single invoice

This commit is contained in:
Mohamed ABDELLANI
2023-08-07 14:53:55 +01:00
committed by Konrad
parent 944925eb06
commit bd2a1b3e22

View File

@@ -99,7 +99,7 @@ module Spree
end
def print
if OpenFoodNetwork::FeatureToggle.enabled?(:invoices)
if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, spree_current_user)
@order = @order.invoices.find(params[:invoice_id]).presenter
end