Skip to content

Commit

Permalink
added detection of events_received key, fixed the missing colon after…
Browse files Browse the repository at this point in the history
… else (#682)

Summary: Pull Request resolved: #682

Reviewed By: yoongyj

Differential Revision: D62390864

Pulled By: stcheng

fbshipit-source-id: 7b37f103687b281104e9125ca52eb242a655b3e0
  • Loading branch information
cnukaus authored and facebook-github-bot committed Sep 10, 2024
1 parent da0789f commit 950f296
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion facebook_business/adobjects/serverside/event_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,14 @@ def execute(self):
fields=[],
params=params,
)
return EventResponse(events_received=response['events_received'],
if response.get('events_received'):
return EventResponse(events_received=response['events_received'],
fbtrace_id=response['fbtrace_id'],
messages=response['messages'])
else:
return EventResponse(events_received=0,
fbtrace_id=response['fbtrace_id'],
messages=response['messages'])

def execute_with_client(self, params):
url = '/'.join([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def execute(self):
return EventResponse(events_received=response['events_received'],
fbtrace_id=response['fbtrace_id'],
messages=response['messages'])
else
else:
return EventResponse(events_received=0,
fbtrace_id=response['fbtrace_id'],
messages=response['messages'])
Expand Down

0 comments on commit 950f296

Please sign in to comment.