#979 tenancy awareness for generic reports

This commit is contained in:
Oliver Gorwits
2023-02-21 11:52:50 +00:00
parent 50f5cf9252
commit 86ef8add72

View File

@@ -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/;$//;