This commit is contained in:
@@ -137,7 +137,7 @@ def setup_routes(app: FastAPI) -> None:
|
|||||||
# 2. Собираем все файлы .docx за период
|
# 2. Собираем все файлы .docx за период
|
||||||
all_files = []
|
all_files = []
|
||||||
current_date = start_date
|
current_date = start_date
|
||||||
while current_date <= finish_date:
|
while current_date <= finish_date + timedelta(days=1):
|
||||||
date_path = current_date.strftime("%Y/%m/%d")
|
date_path = current_date.strftime("%Y/%m/%d")
|
||||||
full_dir_path = os.path.join(DOCUMENTS_DIR, date_path)
|
full_dir_path = os.path.join(DOCUMENTS_DIR, date_path)
|
||||||
|
|
||||||
|
|||||||
@@ -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']}.docx"
|
doc_name = f"{data['title'][:200]}.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