mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 13:50:44 +08:00
Improve actor data extraction logic in Bitbucket app server
This commit is contained in:
@ -164,13 +164,15 @@ 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
|
||||||
|
actor = data.get("data", {}).get("actor", {})
|
||||||
|
if actor:
|
||||||
try:
|
try:
|
||||||
username = data["data"]["actor"]["username"]
|
username = actor["username"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
try:
|
try:
|
||||||
username = data["data"]["actor"]["display_name"]
|
username = actor["display_name"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
username = data["data"]["actor"]["nickname"]
|
username = actor["nickname"]
|
||||||
log_context["sender"] = username
|
log_context["sender"] = username
|
||||||
|
|
||||||
sender_id = data["data"]["actor"]["account_id"]
|
sender_id = data["data"]["actor"]["account_id"]
|
||||||
|
Reference in New Issue
Block a user