Commit b9628932 authored by Matthieu Muffato's avatar Matthieu Muffato Committed by ens-bwalts
Browse files

Analysis must have a resource class (because analysis_base.resource_class_id...

Analysis must have a resource class (because analysis_base.resource_class_id is NOT NULL and a foreign key)
parent 818098bc
......@@ -735,20 +735,14 @@ sub apply_tweaks {
if( $attrib_name eq 'resource_class' ) {
if($operator eq '?') {
if(my $old_value = $analysis->resource_class) {
print "Tweak.Show \tanalysis[$analysis_name].resource_class ::\t".$old_value->name."\n";
} else {
print "Tweak.Show \tanalysis[$analysis_name].resource_class ::\t(missing value)\n";
}
my $old_value = $analysis->resource_class;
print "Tweak.Show \tanalysis[$analysis_name].resource_class ::\t".$old_value->name."\n";
} elsif($operator eq '#') {
print "Tweak.Error \tDeleting of ResourceClasses is not supported\n";
print "Tweak.Error \tDeleting of an Analysis' resource-class is not supported\n";
} else {
if(my $old_value = $analysis->resource_class) {
print "Tweak.Changing\tanalysis[$analysis_name].resource_class ::\t".$old_value->name." --> $new_value_str\n";
} else {
print "Tweak.Adding \tanalysis[$analysis_name].resource_class ::\t(missing value) --> $new_value_str\n"; # do we ever NOT have resource_class set?
}
my $old_value = $analysis->resource_class;
print "Tweak.Changing\tanalysis[$analysis_name].resource_class ::\t".$old_value->name." --> $new_value_str\n";
my $resource_class;
if($resource_class = $self->collection_of( 'ResourceClass' )->find_one_by( 'name', $new_value )) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment