mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge pull request #435 from ONLYOFFICE/feature/python-templates
python: move document-templates to the assets directory
This commit is contained in:
@ -238,7 +238,7 @@ def createSample(fileType, sample, req):
|
||||
filename = getCorrectName(f'{sampleName}{ext}', req) # get file name with an index if such a file name already exists
|
||||
path = getStoragePath(filename, req)
|
||||
|
||||
with io.open(os.path.join('assets', 'sample' if sample == 'true' else 'new', f'{sampleName}{ext}'), 'rb') as stream: # create sample file of the necessary extension in the directory
|
||||
with io.open(os.path.join('assets', 'document-templates', 'sample' if sample == 'true' else 'new', f'{sampleName}{ext}'), 'rb') as stream: # create sample file of the necessary extension in the directory
|
||||
createFile(stream, path, req, True)
|
||||
return filename
|
||||
|
||||
|
||||
@ -396,7 +396,7 @@ def files(request):
|
||||
|
||||
# download a csv file
|
||||
def csv(request):
|
||||
filePath = os.path.join('assets', 'sample', "csv.csv")
|
||||
filePath = os.path.join('assets', 'document-templates', 'sample', "csv.csv")
|
||||
response = docManager.download(filePath)
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user