Skip to content

Commit 5fbb6f4

Browse files
committed
Add tenant to fill_params
1 parent 6c6746a commit 5fbb6f4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/report_compiler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def print_memory_usage(self):
329329
self.human_size(non_heap_memory_usage.getUsed()), self.human_size(non_heap_memory_usage.getMax()))
330330
)
331331

332-
def get_document(self, config, permitted_resources, template, fill_params, format):
332+
def get_document(self, config, permitted_resources, tenant, template, fill_params, format):
333333
"""Return report with specified template and format.
334334
335335
:param obj config: Service config
@@ -378,6 +378,9 @@ def get_document(self, config, permitted_resources, template, fill_params, forma
378378
# Set resource dir in fill_params
379379
fill_params["REPORT_DIR"] = self.report_dir + "/"
380380

381+
# Set the tenant in fill_params
382+
fill_params["TENANT"] = tenant
383+
381384
tmpdir = tempfile.mkdtemp()
382385

383386
# Set virtualizer in fill_params

src/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def get_identity_or_auth(config):
6969
return identity
7070

7171

72-
def get_document_worker(config, permitted_resources, template, args, format):
72+
def get_document_worker(config, permitted_resources, tenant, template, args, format):
7373
result = None
7474

7575
try:
@@ -87,7 +87,7 @@ def get_document_worker(config, permitted_resources, template, args, format):
8787
jpype.java.lang.System.setErr(jpype.java.io.PrintStream(jpype.java.io.File(os.path.join(tmpdir, "stderr"))))
8888

8989
report_compiler = ReportCompiler(app.logger)
90-
result = report_compiler.get_document(config, permitted_resources, template, dict(request.args), format)
90+
result = report_compiler.get_document(config, permitted_resources, tenant, template, dict(request.args), format)
9191

9292
except Exception as e:
9393
app.logger.debug(str(e))
@@ -142,7 +142,7 @@ def get(self, template):
142142
format = 'pdf'
143143

144144
with multiprocessing.Pool(1) as pool:
145-
result = pool.apply(get_document_worker, args=(config, permitted_resources, template, dict(request.args), format))
145+
result = pool.apply(get_document_worker, args=(config, permitted_resources, tenant, template, dict(request.args), format))
146146

147147
return result
148148

0 commit comments

Comments
 (0)