fixed delete checking for category on transaction

This commit is contained in:
Finn 2018-01-16 14:52:16 +00:00
parent ad30cf9cd9
commit dddbb04023

View file

@ -54,7 +54,9 @@ sub delete {
my $id = $c->param('id');
if ( my $transaction = $c->result_set->find($id) ) {
if (defined $transaction->category) {
$transaction->category->delete;
}
$transaction->delete;
$c->flash( success => 'Successfully deleted transaction' );
$c->redirect_to( '/admin/transactions' );