mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #2597
This commit is contained in:
parent
793af1991c
commit
cbde7037ab
@ -140,7 +140,9 @@ class CurrencyController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->repository->currencyInUse($currency)) {
|
if ($this->repository->currencyInUse($currency)) {
|
||||||
$request->session()->flash('error', (string)trans('firefly.cannot_delete_currency', ['name' => e($currency->name)]));
|
$location = $this->repository->currencyInUseAt($currency);
|
||||||
|
$message = (string)trans(sprintf('firefly.cannot_disable_currency_%s', $location), ['name' => e($currency->name)]);
|
||||||
|
$request->session()->flash('error', $message);
|
||||||
Log::channel('audit')->info(sprintf('Tried to visit page to delete currency %s but currency is in use.', $currency->code));
|
Log::channel('audit')->info(sprintf('Tried to visit page to delete currency %s but currency is in use.', $currency->code));
|
||||||
|
|
||||||
return redirect(route('currencies.index'));
|
return redirect(route('currencies.index'));
|
||||||
|
@ -50,7 +50,7 @@ class CurrencyDestroyService
|
|||||||
{
|
{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$currency->forceDelete();
|
$currency->delete();
|
||||||
} catch (Exception $e) { // @codeCoverageIgnore
|
} catch (Exception $e) { // @codeCoverageIgnore
|
||||||
Log::error(sprintf('Could not delete transaction currency: %s', $e->getMessage())); // @codeCoverageIgnore
|
Log::error(sprintf('Could not delete transaction currency: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user