diff --git a/app/controllers/transactions_controller.rb b/app/controllers/transactions_controller.rb index fbcd89c189..4d645b1a50 100644 --- a/app/controllers/transactions_controller.rb +++ b/app/controllers/transactions_controller.rb @@ -371,7 +371,7 @@ def update_preferences end def exchange_rate - account = Current.family.accounts.find(params[:account_id]) + account = Current.user.accessible_accounts.find(params[:account_id]) currency_from = params[:currency] date = params[:date]&.to_date || Date.current diff --git a/app/views/import/uploads/show.html.erb b/app/views/import/uploads/show.html.erb index 7cf51d6514..e6622bbdc7 100644 --- a/app/views/import/uploads/show.html.erb +++ b/app/views/import/uploads/show.html.erb @@ -56,7 +56,7 @@ <%= styled_form_with model: @import, scope: :import, url: import_upload_path(@import), multipart: true, class: "space-y-4" do |form| %> <%= form.select :account_id, - @import.family.accounts.visible.alphabetically.pluck(:name, :id), + accessible_accounts.visible.alphabetically.pluck(:name, :id), { label: t(".qif_account_label"), include_blank: t(".qif_account_placeholder"), selected: @import.account_id }, required: true %> @@ -112,7 +112,7 @@ <%= form.select :col_sep, Import.separator_options, label: true %> <% if @import.type == "TransactionImport" || @import.type == "TradeImport" %> - <%= form.select :account_id, @import.family.accounts.visible.alphabetically.pluck(:name, :id), { label: t(".account_optional_label"), include_blank: t(".multi_account_import"), selected: @import.account_id } %> + <%= form.select :account_id, accessible_accounts.visible.alphabetically.pluck(:name, :id), { label: t(".account_optional_label"), include_blank: t(".multi_account_import"), selected: @import.account_id } %> <% end %>