diff --git a/hooks/subjects.pl b/hooks/subjects.pl index 75ac74d..f6425e1 100755 --- a/hooks/subjects.pl +++ b/hooks/subjects.pl @@ -375,17 +375,22 @@ sub tag_project my $mod = 0; for my $vcs ($dom->documentElement()->getElementsByTagName("vcs")) { + if (! $vcs->hasAttribute("tag") || $vcs->getAttribute("tag") =~ /^(ACU|YAKA)-/) { + log ERROR, "Un tag de rendu ne peut pas commencer par ACU- ou YAKA-."; # C'est réservé pour les moulettes + } + if (! $vcs->hasAttribute("token")) { if ($project) { # Looking for an old token my @rendus = grep { - exists $_->{vcs} and $_->{vcs}{tag} eq $vcs->hasAttribute("tag"); + exists $_->{vcs} and $_->{vcs}{tag} eq $vcs->getAttribute("tag"); } @{ $project->{submissions} }; - if (@rendus == 1) { - log INFO, "Use existing token: ".$rendus[0]->{vcs}{token}; + if (@rendus == 1) + { + log DEBUG, "Use existing token: ".$rendus[0]->{vcs}{token}; $vcs->setAttribute("token", substr($rendus[0]->{vcs}{token}, 2, 23)); $mod = 1; next;