Skip to content

Commit

Permalink
hotfix for save pull request body
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Feb 2, 2024
1 parent 0b61968 commit bfccfa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/tasks/github/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def on_issue_updated(event_dict: dict) -> list:

if issue:
issue.title = issue_info.title
issue.description = issue_info.body
issue.description = issue_info.body[:1000] if issue_info.body else None
issue.extra = issue_info.model_dump()

db.session.commit()
Expand Down
6 changes: 4 additions & 2 deletions server/tasks/github/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def on_pull_request_opened(event_dict: dict | list | None) -> list:
repo_id=repo.id,
pull_request_number=pr_info.number,
title=pr_info.title,
description=pr_info.body[:1000],
description=pr_info.body[:1000] if pr_info.body else "",
base=pr_info.base.ref,
head=pr_info.head.ref,
state=pr_info.state,
Expand Down Expand Up @@ -105,7 +105,9 @@ def on_pull_request_updated(event_dict: dict) -> list:
)
if pr:
pr.title = event.pull_request.title
pr.description = event.pull_request.body
pr.description = (
event.pull_request.body[:1000] if event.pull_request.body else ""
)
pr.base = event.pull_request.base.ref
pr.head = event.pull_request.head.ref
pr.state = event.pull_request.state
Expand Down

0 comments on commit bfccfa3

Please sign in to comment.