fix: paper save时缺少字段

This commit is contained in:
caoqianming 2026-01-27 14:45:17 +08:00
parent 38b74e64f1
commit cfbd94c8b0
1 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,9 @@ def get_abstract_from_elsevier(publication_year: int = None, number_of_task:int
paper_file = os.path.join(paper_dir, f"{safe_doi}.xml")
with open(paper_file, "wb") as f:
f.write(xml_str.encode("utf-8"))
paper.save(update_fields=["has_abstract", "has_abstract_xml", "has_fulltext", "has_fulltext_xml", "update_time"])
paper.save(update_fields=["has_abstract",
"has_abstract_xml", "has_fulltext",
"has_fulltext_xml", "update_time", "fetch_status", "fail_reason"])
elif res.status_code == 404:
paper.fail_reason = "elsevier_doi_not_found"