Skip to content

Commit

Permalink
reverted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hagen-danswer committed Oct 29, 2024
1 parent ee47b95 commit 6ee602c
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions backend/danswer/connectors/confluence/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
"restrictions.read.restrictions.group",
]

_NO_PARENT_OR_NO_PERMISSIONS_ERROR_STR = (
"No parent or not permitted to view content with id"
)


class ConfluenceConnector(LoadConnector, PollConnector, SlimConnector):
def __init__(
Expand Down Expand Up @@ -123,21 +119,16 @@ def _get_comment_string_for_page_id(self, page_id: str) -> str:
comment_cql += self.cql_label_filter

expand = ",".join(_COMMENT_EXPANSION_FIELDS)
try:
for comments in self.confluence_client.paginated_cql_page_retrieval(
cql=comment_cql,
expand=expand,
):
for comment in comments:
comment_string += "\nComment:\n"
comment_string += extract_text_from_confluence_html(
confluence_client=self.confluence_client,
confluence_object=comment,
)
except Exception as e:
logger.exception("error fetching comments: \n")
if _NO_PARENT_OR_NO_PERMISSIONS_ERROR_STR not in str(e):
raise
for comments in self.confluence_client.paginated_cql_page_retrieval(
cql=comment_cql,
expand=expand,
):
for comment in comments:
comment_string += "\nComment:\n"
comment_string += extract_text_from_confluence_html(
confluence_client=self.confluence_client,
confluence_object=comment,
)

return comment_string

Expand Down

0 comments on commit 6ee602c

Please sign in to comment.