Skip to content

Commit

Permalink
[8.x] Change dto for page blog documents to access fields in safe man…
Browse files Browse the repository at this point in the history
…ner (#2984) (#2986)

Co-authored-by: Artem Shelkovnikov <[email protected]>
Co-authored-by: Jedr Blaszyk <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent 25acf7a commit fa53dcb
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions connectors/sources/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,14 +908,22 @@ 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": html_to_text(document["body"]["storage"]["value"]),
"space": nested_get_from_dict(document, ["space", "name"]),
"body": html_to_text(
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 fa53dcb

Please sign in to comment.