Skip to content

Commit 46f0ce1

Browse files
committed
Omit ./ in generated document template resources if report is placed in toplevel directory
1 parent 1adaf4b commit 46f0ce1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/config_generator/document_service_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def config(self):
4141
scanned_document_templates = []
4242
for root, dirs, files in os.walk(self.report_dir):
4343
subdir = os.path.relpath(root, self.report_dir)
44+
if subdir == ".":
45+
subdir = ""
4446
scanned_document_templates += [
4547
os.path.join(subdir, file[:-6]) for file in files if file.endswith(".jrxml")
4648
]
@@ -106,6 +108,8 @@ def permissions(self, role):
106108
available_document_templates = []
107109
for root, dirs, files in os.walk(self.report_dir):
108110
subdir = os.path.relpath(root, self.report_dir)
111+
if subdir == ".":
112+
subdir = ""
109113
available_document_templates += [
110114
os.path.join(subdir, file[:-6]) for file in files if file.endswith(".jrxml")
111115
]

0 commit comments

Comments
 (0)