From 86ef8add720adb6dbf952744f7fd7a48c1816da8 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 21 Feb 2023 11:52:50 +0000 Subject: [PATCH] #979 tenancy awareness for generic reports --- lib/App/Netdisco/Web/GenericReport.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/;$//;