Skip to content

Commit

Permalink
[8.15] Change dto for page blog documents to access fields in safe ma…
Browse files Browse the repository at this point in the history
…nner (#2984) (#2988)

Co-authored-by: Jedr Blaszyk <[email protected]>
  • Loading branch information
artem-shelkovnikov and jedrazb authored Nov 22, 2024
1 parent b235087 commit fd1ddd2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions connectors/sources/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,14 +895,20 @@ async def fetch_documents(self, api_query):
doc = {
"_id": str(document["id"]),
"type": document["type"],
"_timestamp": document["history"]["lastUpdated"]["when"],
"_timestamp": nested_get_from_dict(
document, ["history", "lastUpdated", "when"]
),
"title": document.get("title"),
"ancestors": ancestor_title,
"space": document["space"]["name"],
"body": document["body"]["storage"]["value"],
"space": nested_get_from_dict(document, ["space", "name"]),
"body": nested_get_from_dict(document, ["body", "storage", "value"]),
"url": document_url,
"author": document["history"]["createdBy"][self.authorkey],
"createdDate": document["history"]["createdDate"],
"author": nested_get_from_dict(
document, ["history", "createdBy", self.authorkey]
),
"createdDate": nested_get_from_dict(
document, ["history", "createdDate"]
),
}
if self.confluence_client.index_labels:
doc["labels"] = document["labels"]
Expand Down

0 comments on commit fd1ddd2

Please sign in to comment.