diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 74fea6e9..d3490636 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -151,8 +151,8 @@ sub updateProject { , nixexprinput => $nixExprInput }); } else { # it's an existing jobset - $jobset = ($project->jobsets->search({name => $baseName}))[0]; - die unless defined $jobset; + my $oldName = trim $c->request->params->{"jobset-$baseName-oldName"}; + $jobset = ($project->jobsets->search({name => $oldName}))[0] or die; $jobset->update( { name => $jobsetName, description => $description , nixexprpath => $nixExprPath, nixexprinput => $nixExprInput }); diff --git a/src/root/project.tt b/src/root/project.tt index 0537043d..e30927ba 100644 --- a/src/root/project.tt +++ b/src/root/project.tt @@ -67,6 +67,8 @@
+ "jobset-$baseName-oldName", value => jobset.name) %] /> +

[% IF edit %][% END %] [% IF jobset %]Jobset [% jobset.name %][% ELSE %]New jobset[% END %] @@ -250,8 +252,8 @@ [% END %] - [% FOREACH jobset IN project.jobsets -%] - [% INCLUDE renderJobset jobset=jobset baseName=jobset.name %] + [% n = 0; FOREACH jobset IN project.jobsets -%] + [% INCLUDE renderJobset jobset=jobset baseName="e$n"; n = n + 1 %] [% END -%] [% ELSE %]