H66SHOS74FVD2PCJH63MLRMFZQTPNTCGCWQKAZVTZXYCREJDUGOAC
NPG7RSJLJKQ6GUFQ7ZWC3GDF3OCV52YFBOV3WDOHRQLZ2JTVCCBQC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
LZVO64YG43JD7YMZSCTZNOBS5ROZA4FMPKJW2YOMHX2V5PTGBVWQC
3NO4SUUGGG3PG5HD5OPGSOYGKUEAT5FWLNIHKBECQBP35DKWANUAC
JARRBLZDQ2JZWY7IUVPTOT7WJMBPMLFLF2MGLVGOYROAAISYGLSAC
HQGXL4MXGHICQ3IRRQUR6KQHS2RKVOTDKQ5ZETXHQ56DANR2YADQC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
], join => [ 'owner', 'views', 'releases', 'jobsets' ], order_by => { -desc => "releases.timestamp" }, collapse => 1 });
], join => [ 'owner', 'releases', 'jobsets' ], order_by => { -desc => "releases.timestamp" }, collapse => 1 });
if ($project) {
$c->stash->{project} = $project;
} else {
if ($c->action->name eq "project" and $c->request->method eq "PUT") {
$c->stash->{projectName} = $projectName;
} else {
$self->status_not_found(
$c,
message => "Project $projectName doesn't exist."
);
$c->detach;
}
if (!$c->stash->{project} && !($c->action->name eq "project" and $c->request->method eq "PUT")) {
$self->status_not_found($c, message => "Project ‘$projectName’ doesn't exist.");
$c->detach;
} elsif (defined $c->stash->{params}->{oldName}) {
my $project = $c->model('DB::Projects')->find($c->stash->{params}->{oldName});
if (defined $project) {
requireProjectOwner($c, $project);
txn_do($c->model('DB')->schema, sub {
updateProject($c, $project);
});
my $uri = $c->uri_for($self->action_for("project"), [$project->name]);
}
if ($c->req->looks_like_browser) {
$c->res->redirect($uri . "#tabs-configuration");
} else {
$self->status_created(
$c,
location => "$uri",
entity => { name => $project->name, uri => "$uri", type => "project" }
);
}
} else {
$self->status_not_found(
$c,
message => "Project $c->stash->{params}->{oldName} doesn't exist."
);
}
} else {
else {
error($c, "Invalid owner: $owner")
unless defined $c->model('DB::Users')->find({username => $owner});
error($c, "The user name ‘$owner’ does not exist.")
unless defined $c->model('DB::Users')->find($owner);
my $projectName = $c->stash->{projectName} or $project->name;
error($c, "Invalid project name: ‘$projectName’") if $projectName !~ /^$projectNameRE$/;
my $projectName = $c->stash->{params}->{name};
error($c, "Invalid project name ‘$projectName’.") if $projectName !~ /^$projectNameRE$/;