Skip to content

Commit 788b436

Browse files
committed
fix filefield instance.id
1 parent d1c48b8 commit 788b436

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pythonkr_backend/curation/utils_trans.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ def translate_rssitem(rss_item_id: int):
6969
source_url=rss_item.link
7070
)
7171

72+
# save to get instance id
73+
translated_content.save()
7274
# Save the translated content to a file
7375
content_file = ContentFile(result.output.content, name=f"{rss_item.id}-translated.md")
7476
translated_content.content.save(f"{rss_item.id}-translated.md", content_file)
75-
76-
# Save the instance
77+
# save again to update the content field
7778
translated_content.save()
7879

7980
# Create LLM usage record

0 commit comments

Comments
 (0)