diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index a791c1929..b34845b84 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -1,8 +1,9 @@ class ImportsController < ApplicationController - disallow_account_scope only: %i[ new create ] - layout "public" + disallow_account_scope only: %i[ new create ] + before_action :set_import, only: %i[ show ] + def new end @@ -17,10 +18,13 @@ class ImportsController < ApplicationController end def show - @import = Current.account.imports.find(params[:id]) end private + def set_import + @import = Current.account.imports.find(params[:id]) + end + def start_import(account) import = nil diff --git a/app/models/export.rb b/app/models/export.rb index 9560fe122..dde40b28d 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -29,7 +29,7 @@ class Export < ApplicationRecord end rescue => e update!(status: :failed) - raise + raise e ensure zipfile&.close zipfile&.unlink