Fix upload tests for entity upgrade
This commit is contained in:
parent
e91863a3d7
commit
dd6e21eb50
3 changed files with 24 additions and 21 deletions
|
@ -112,7 +112,7 @@ sub post_upload {
|
|||
|
||||
if ( $type == 1 ) {
|
||||
# Validated Organisation
|
||||
my $valid_org_rs = $c->schema->resultset('Organisation');
|
||||
my $valid_org_rs = $c->schema->resultset('Organisation')->search({ pending => 0 });
|
||||
$validation->required('organisation_id')->number->in_resultset( 'id', $valid_org_rs );
|
||||
|
||||
return $c->api_validation_error if $validation->has_error;
|
||||
|
@ -121,7 +121,7 @@ sub post_upload {
|
|||
|
||||
} elsif ( $type == 2 ) {
|
||||
# Unvalidated Organisation
|
||||
my $valid_org_rs = $c->schema->resultset('PendingOrganisation')->search({ submitted_by_id => $user->id });
|
||||
my $valid_org_rs = $c->schema->resultset('Organisation')->search({ submitted_by_id => $user->id, pending => 1 });
|
||||
$validation->required('organisation_id')->number->in_resultset( 'id', $valid_org_rs );
|
||||
|
||||
return $c->api_validation_error if $validation->has_error;
|
||||
|
|
|
@ -35,7 +35,7 @@ __PACKAGE__->add_columns(
|
|||
},
|
||||
"proof_image" => {
|
||||
data_type => "text",
|
||||
is_nullable => 0,
|
||||
is_nullable => 1,
|
||||
},
|
||||
"submitted_at" => {
|
||||
data_type => "datetime",
|
||||
|
|
Reference in a new issue