diff --git a/lib/Lutim/Controller.pm b/lib/Lutim/Controller.pm index 54acf3e..5d89aef 100644 --- a/lib/Lutim/Controller.pm +++ b/lib/Lutim/Controller.pm @@ -121,10 +121,10 @@ sub modify { } else { $c->app->log->info('[MODIFICATION] someone modify '.$image->filename.' with token method (path: '.$image->path.')'); - $image->update( - delete_at_day => ($c->param('delete-day') && ($c->param('delete-day') <= $c->max_delay || $c->max_delay == 0)) ? $c->param('delete-day') : $c->max_delay, - delete_at_first_view => ($c->param('first-view')) ? 1 : 0, - ); + $image->delete_at_day(($c->param('delete-day') && ($c->param('delete-day') <= $c->max_delay || $c->max_delay == 0)) ? $c->param('delete-day') : $c->max_delay); + $image->delete_at_first_view(($c->param('first-view')) ? 1 : 0); + $image->write; + $msg = $c->l('The image\'s delay has been successfully modified'); if (defined($c->param('format')) && $c->param('format') eq 'json') { return $c->render(