[3/3] testbot/web: Refresh the JobDetails page normally after canceling or restarting a job.

Francois Gouget fgouget at codeweavers.com
Thu Mar 28 08:43:28 CDT 2013


This is possible now that Job::Cancel() updates the job status synchronously.
---
 testbot/web/JobDetails.pl |   27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 429a87c..944d178 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -167,7 +167,8 @@ sub OnCancel
     return !1;
   }
 
-  return 1;
+  $self->Redirect("/JobDetails.pl?Key=" . $self->{JobId});
+  exit;
 }
 
 sub OnRestart
@@ -188,7 +189,8 @@ sub OnRestart
     return !1;
   }
 
-  return 1;
+  $self->Redirect("/JobDetails.pl?Key=" . $self->{JobId});
+  exit;
 }
 
 sub OnAction
@@ -238,27 +240,6 @@ sub GenerateBody
 {
   my $self = shift;
 
-  if ($self->{ActionPerformed})
-  {
-    print "<h1>" . $self->GetTitle() . "</h1>\n";
-    print "<div class='Content'>\n";
-    my $Action = $self->GetParam("Action");
-    if ($Action eq "Cancel job")
-    {
-      print "<p>Job will be canceled.</p>\n";
-    }
-    elsif ($Action eq "Restart job")
-    {
-      print "<p>Job will be restarted.</p>\n";
-    }
-    else
-    {
-      print "<p>Unknown action $Action.</p>\n";
-    }
-    print "</div>\n";
-    return;
-  }
-
   $self->SUPER::GenerateBody(@_);
 
   print "<div class='Content'>\n";
-- 
1.7.10.4



More information about the wine-patches mailing list