mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Allow local DFC import in development
This commit is contained in:
@@ -42,13 +42,21 @@ module Admin
|
||||
'Authorization' => "Bearer #{spree_current_user.oidc_account.token}",
|
||||
}
|
||||
)
|
||||
response = PrivateAddressCheck.only_public_connections do
|
||||
response = only_public_connections do
|
||||
connection.get(url)
|
||||
end
|
||||
|
||||
response.body
|
||||
end
|
||||
|
||||
def only_public_connections
|
||||
return yield if Rails.env.development?
|
||||
|
||||
PrivateAddressCheck.only_public_connections do
|
||||
yield
|
||||
end
|
||||
end
|
||||
|
||||
# Most of this code is the same as in the DfcProvider::SuppliedProductsController.
|
||||
def import_product(subject, enterprise)
|
||||
return unless subject.is_a? DataFoodConsortium::Connector::SuppliedProduct
|
||||
|
||||
Reference in New Issue
Block a user