diff options
author | lpsolit%gmail.com <> | 2009-10-04 20:52:36 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2009-10-04 20:52:36 +0000 |
commit | 1c431100cc82989b40652706add9f024de30ca56 (patch) | |
tree | 6f3fbc55d532b1985007e8bed73842b2d9b3ef60 /chart.cgi | |
parent | Bug 364254: Add hook to Bugzilla::Template::quoteUrls (diff) | |
download | bugzilla-1c431100cc82989b40652706add9f024de30ca56.tar.gz bugzilla-1c431100cc82989b40652706add9f024de30ca56.tar.bz2 bugzilla-1c431100cc82989b40652706add9f024de30ca56.zip |
Bug 519040: After creating a new series, redirect the user to a more useful page - Patch by Frédéric Buclin <LpSolit@gmail.com> r=gerv a=LpSolit
Diffstat (limited to 'chart.cgi')
-rwxr-xr-x | chart.cgi | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -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"); |