Skip to content

Commit

Permalink
Merge pull request #842 from longguikeji/feature-207
Browse files Browse the repository at this point in the history
fix: 🐛 修复webhook_event_handler 处理response报错
  • Loading branch information
fanhe-lg authored May 20, 2022
2 parents 87c75e5 + 7950b79 commit 965d408
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arkid/core/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ def get_event_payload(event):
request = None
response = None

if event.request:
if event.request and isinstance(event.request, HttpRequest):
request = {
"body": str(event.request.body, encoding='utf-8'),
}

if event.response:
if event.response and isinstance(event.response, HttpResponse):
response = {
"body": str(event.response.body, encoding='utf-8'),
"status_code": event.response.status_code,
}
elif type(event.response) is dict:
response = event.response
payload = {
"tag": event.tag,
"tenant": event.tenant.id.hex,
Expand Down

0 comments on commit 965d408

Please sign in to comment.