fix: paper save时缺少字段
This commit is contained in:
parent
38b74e64f1
commit
cfbd94c8b0
|
|
@ -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")
|
paper_file = os.path.join(paper_dir, f"{safe_doi}.xml")
|
||||||
with open(paper_file, "wb") as f:
|
with open(paper_file, "wb") as f:
|
||||||
f.write(xml_str.encode("utf-8"))
|
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:
|
elif res.status_code == 404:
|
||||||
paper.fail_reason = "elsevier_doi_not_found"
|
paper.fail_reason = "elsevier_doi_not_found"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue