diff --git a/lib/App/Netdisco/Web/GenericReport.pm b/lib/App/Netdisco/Web/GenericReport.pm index dccd1e04..08cc2abb 100644 --- a/lib/App/Netdisco/Web/GenericReport.pm +++ b/lib/App/Netdisco/Web/GenericReport.pm @@ -29,7 +29,7 @@ foreach my $report (@{setting('reports')}) { # TODO: this should be done by creating a new Virtual Result class on # the fly (package...) and then calling DBIC register_class on it. - my $schema = ($report->{database} || 'netdisco'); + my $schema = ($report->{database} || vars->{'tenant'}); my $rs = schema($schema)->resultset('Virtual::GenericReport')->result_source; (my $query = $report->{query}) =~ s/;$//;