]> git.rustad.me Git - duplo/commitdiff
Delete old team when editing team
authorBjørn Rustad <rustadbjornen@gmail.com>
Thu, 15 Aug 2013 19:26:51 +0000 (21:26 +0200)
committerBjørn Rustad <rustadbjornen@gmail.com>
Thu, 15 Aug 2013 19:26:51 +0000 (21:26 +0200)
lib/Duplo/Manager.pm

index f766d7cc47763e4f6984ba02aae0f610d94db9a9..20553ee3ce6e892ee4bfdd9792ee2811a24dfbbb 100644 (file)
@@ -205,6 +205,15 @@ sub edit {
                return $self->redirect_to('manager_team', team => $team)
        }
 
+       $dbh->do("
+               DELETE FROM
+                 rider_manager_team
+               WHERE
+                 manager_team = ?
+               AND
+                 stage = ?
+               ", undef, $team, $stage);
+
        my $sth = $dbh->prepare("
                INSERT INTO
                  rider_manager_team (rider, manager_team, stage)