diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 15c98f6e5e..7239ba309a 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -107,6 +107,12 @@ class PiggyBankController extends Controller $subTitle = trans('firefly.new_piggy_bank'); $subTitleIcon = 'fa-plus'; + if (count($accounts) === 0) { + Session::flash('error', strval(trans('firefly.need_at_least_one_account'))); + + return redirect(route('new-user.index')); + } + // put previous url in session if not redirect from store (not "create another"). if (session('piggy-banks.create.fromStore') !== true) { Session::put('piggy-banks.create.url', URL::previous()); diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 2fa1eb4e59..0ec1a957b4 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -867,11 +867,9 @@ return [ 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', 'import_finished_all' => 'The import has finished. Please check out the results below.', 'import_with_key' => 'Import with key \':key\'', - - 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', - - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', - + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + 'need_at_least_one_account' => 'You need at least one asset account to be able to create piggy banks', ];