]> git.rustad.me Git - duplo/commitdiff
Director stacking points bug
authorBjørn Rustad <rustadbjornen@gmail.com>
Mon, 26 Aug 2013 10:59:41 +0000 (12:59 +0200)
committerBjørn Rustad <rustadbjornen@gmail.com>
Mon, 26 Aug 2013 10:59:41 +0000 (12:59 +0200)
lib/Duplo/Points.pm

index 7078e22d262d14e4870a033644d834c4f9a75916..5c751564d023cc79de7d0e202a4984ab8f1a2a19 100644 (file)
@@ -338,13 +338,11 @@ sub calculate {
                VALUES (?, ?, ?)
                ");
 
-       $update = $dbh->prepare("
-               UPDATE
+       $dbh->do("
+               DELETE FROM
                  director_stage
-               SET points = points + ?
                WHERE stage = ?
-               AND director = ?
-               ");
+               ", undef, $stage);
 
        my $i = 1;
        for my $res (@{ $finish_ref }) {
@@ -357,7 +355,6 @@ sub calculate {
                }
 
                $insert->execute($p, $stage, $res->{'team'})
-                       or $update->execute($p, $stage, $res->{'team'});
 
                $i++;
        }