mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 20:30:41 +08:00
Improve actor data extraction logic in Bitbucket app server
This commit is contained in:
@ -164,14 +164,16 @@ async def handle_github_webhooks(background_tasks: BackgroundTasks, request: Req
|
|||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
# Get the username of the sender
|
# Get the username of the sender
|
||||||
try:
|
actor = data.get("data", {}).get("actor", {})
|
||||||
username = data["data"]["actor"]["username"]
|
if actor:
|
||||||
except KeyError:
|
|
||||||
try:
|
try:
|
||||||
username = data["data"]["actor"]["display_name"]
|
username = actor["username"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
username = data["data"]["actor"]["nickname"]
|
try:
|
||||||
log_context["sender"] = username
|
username = actor["display_name"]
|
||||||
|
except KeyError:
|
||||||
|
username = actor["nickname"]
|
||||||
|
log_context["sender"] = username
|
||||||
|
|
||||||
sender_id = data["data"]["actor"]["account_id"]
|
sender_id = data["data"]["actor"]["account_id"]
|
||||||
log_context["sender_id"] = sender_id
|
log_context["sender_id"] = sender_id
|
||||||
|
Reference in New Issue
Block a user