[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH] testbot/web: Remove unnecessary LastPage checks in Submit.
From:       Francois Gouget <fgouget () codeweavers ! com>
Date:       2018-11-30 11:55:07
Message-ID: E1gShNz-0003q0-Dr () amboise
[Download RAW message or body]

Only Submit.pl can decide when to call Validate() because only it knows
whether this is appropriate for the current action. And this always
happens as a check before moving on to the next page which means
$self->{Page} is equal to $self->{LastPage}.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
---
 testbot/web/Submit.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 8a30110193..c73ff425c4 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -461,7 +461,7 @@ sub Validate($)
 {
   my ($self) = @_;
 
-  if ($self->{Page} == 2 && $self->{LastPage} == 2)
+  if ($self->{Page} == 2)
   {
     my $VMSelected = !1;
     my $VMs = CreateVMs();
@@ -481,7 +481,7 @@ sub Validate($)
       return !1;
     }
   }
-  elsif ($self->{Page} == 3 && $self->{LastPage} == 3)
+  elsif ($self->{Page} == 3)
   {
     if (($self->GetParam("FileType") eq "patch" &&
          $self->GetParam("TestExecutable") !~ m/^[\w_.]+_test\.exe$/) ||
-- 
2.19.1



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic