убрал ограничение по сохранению док файла
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -145,7 +145,6 @@ def setup_routes(app: FastAPI) -> None:
|
|||||||
for file in os.listdir(full_dir_path):
|
for file in os.listdir(full_dir_path):
|
||||||
if file.endswith('.docx'):
|
if file.endswith('.docx'):
|
||||||
file_title = file[:-5] # убираем расширение .docx
|
file_title = file[:-5] # убираем расширение .docx
|
||||||
file_title = file_title[:100]
|
|
||||||
if file_title in titles_from_db:
|
if file_title in titles_from_db:
|
||||||
all_files.append(os.path.join(full_dir_path, file))
|
all_files.append(os.path.join(full_dir_path, file))
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ def update_bd_and_create_document(
|
|||||||
doc.add_heading('Оригинальный текст', level=1)
|
doc.add_heading('Оригинальный текст', level=1)
|
||||||
doc.add_paragraph(original_text)
|
doc.add_paragraph(original_text)
|
||||||
|
|
||||||
doc_name = f"{data['title'][:100]}.docx"
|
doc_name = f"{data['title']}.docx"
|
||||||
doc_path = os.path.join(documents_path, doc_name)
|
doc_path = os.path.join(documents_path, doc_name)
|
||||||
doc.save(doc_path)
|
doc.save(doc_path)
|
||||||
print(f"Сохранен документ: {doc_path}")
|
print(f"Сохранен документ: {doc_path}")
|
||||||
|
|||||||
Reference in New Issue
Block a user