fixed delete checking for category on transaction

This commit is contained in:
Finn 2018-01-16 14:52:16 +00:00
parent 5ad83795bd
commit 85a9647294

View file

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