fix: keyerror on comment create and update (#492)

This commit is contained in:
pablohashescobar 2023-03-24 00:12:56 +05:30 committed by GitHub
parent 765cfdbf7e
commit 2501c819d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -676,8 +676,8 @@ def create_comment_activity(
verb="created",
actor=actor,
field="comment",
new_value=requested_data.get("comment_html"),
new_identifier=requested_data.get("id"),
new_value=requested_data.get("comment_html", ""),
new_identifier=requested_data.get("id", None),
issue_comment_id=requested_data.get("id", None),
)
)
@ -696,11 +696,11 @@ def update_comment_activity(
verb="updated",
actor=actor,
field="comment",
old_value=current_instance.get("comment_html"),
old_value=current_instance.get("comment_html", ""),
old_identifier=current_instance.get("id"),
new_value=requested_data.get("comment_html"),
new_identifier=current_instance.get("id"),
issue_comment_id=current_instance.get("id"),
new_value=requested_data.get("comment_html", ""),
new_identifier=current_instance.get("id", None),
issue_comment_id=current_instance.get("id", None),
)
)