From eed2b3c8a7a2c4494855b29f34f6f529d06edca0 Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Thu, 29 Jan 2026 15:26:30 +0100 Subject: [PATCH] Cleanup code --- app/controllers/imports_controller.rb | 10 +++++++--- app/models/export.rb | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) 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