2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 19:20:55 +00:00

Ensure correct path separator is returned

This commit is contained in:
Oliver Walters
2020-09-13 21:10:11 +10:00
parent adaaa1e81d
commit d674eacd78
4 changed files with 617 additions and 389 deletions

View File

@ -89,7 +89,16 @@ class ReportTemplateBase(models.Model):
@property
def template_name(self):
return os.path.join('report_template', self.getSubdir(), os.path.basename(self.template.name))
"""
Returns the file system path to the template file.
Required for passing the file to an external process (e.g. LaTeX)
"""
template = os.path.join('report_template', self.getSubdir(), os.path.basename(self.template.name))
template = template.replace('/', os.path.sep)
template = template.replace('\\', os.path.sep)
return template
def get_context_data(self, request):
"""