From e3898694146eba20ffb10a33e4fb63d0505ddc7c Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 7 Jun 2017 22:00:10 +0200 Subject: [PATCH] Fix bug in image's delay modification --- lib/Lutim/Controller.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(