Return HTTP 400 when creating Project with nonexistent user

This commit is contained in:
Cole Helbling
2021-04-26 11:28:42 -07:00
parent 85e299d3d7
commit 47e19ba22c
3 changed files with 16 additions and 2 deletions

View File

@ -135,7 +135,7 @@ sub updateProject {
my $owner = $project->owner;
if ($c->check_user_roles('admin') and defined $c->stash->{params}->{owner}) {
$owner = trim $c->stash->{params}->{owner};
error($c, "The user name $owner does not exist.")
badRequest($c, "The user name $owner does not exist.")
unless defined $c->model('DB::Users')->find($owner);
}