From 1c431100cc82989b40652706add9f024de30ca56 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sun, 4 Oct 2009 20:52:36 +0000 Subject: Bug 519040: After creating a new series, redirect the user to a more useful page - Patch by Frédéric Buclin r=gerv a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chart.cgi | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'chart.cgi') diff --git a/chart.cgi b/chart.cgi index 60a347253..61bde60eb 100755 --- a/chart.cgi +++ b/chart.cgi @@ -142,19 +142,15 @@ elsif ($action eq "create") { my $series = new Bugzilla::Series($cgi); - if (!$series->existsInDatabase()) { - $series->writeToDatabase(); - $vars->{'message'} = "series_created"; - } - else { - ThrowUserError("series_already_exists", {'series' => $series}); - } + ThrowUserError("series_already_exists", {'series' => $series}) + if $series->existsInDatabase; + $series->writeToDatabase(); + $vars->{'message'} = "series_created"; $vars->{'series'} = $series; - print $cgi->header(); - $template->process("global/message.html.tmpl", $vars) - || ThrowTemplateError($template->error()); + my $chart = new Bugzilla::Chart($cgi); + view($chart); } elsif ($action eq "edit") { detaint_natural($series_id) || ThrowCodeError("invalid_series_id"); -- cgit v1.2.3-24-g4f1b