Skip to content

Commit

Permalink
if an object already has a space, use the same one for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Mar 27, 2024
1 parent 1fb3938 commit a2993e0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ async def create_live_paper(

for category in ("people", "paper", "sections"): # the order is important
for obj in kg_objects[category]:
obj.save(kg_user_client, space=kg_space, recursive=True, ignore_auth_errors=True)
obj.save(kg_user_client, space=obj.space or kg_space, recursive=True, ignore_auth_errors=True)
logger.info("Saved objects")
return LivePaperSummary.from_kg_object(kg_objects["paper"][-1], kg_user_client)

Expand Down Expand Up @@ -270,7 +270,7 @@ async def update_live_paper(

for category in ("people", "paper", "sections"): # the order is important
for obj in kg_objects[category]:
obj.save(kg_client, space=kg_space, recursive=True)
obj.save(kg_client, space=obj.space or kg_space, recursive=True)
logger.info("Saved objects")

return None
Expand Down

0 comments on commit a2993e0

Please sign in to comment.