Skip to content

Commit

Permalink
Only unpack dicts in P2A campaigns response if the response has data (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenSpicknall authored May 2, 2022
1 parent 41ebf4a commit 5261acc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions parsons/phone2action/p2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ def get_campaigns(self, state=None, zip=None, include_generic=False, include_pri
}

tbl = Table(self.client.get_request('campaigns', params=args))
tbl.unpack_dict('updated_at')
if include_content:
tbl.unpack_dict('content')
if tbl:
tbl.unpack_dict('updated_at')
if include_content:
tbl.unpack_dict('content')

return tbl

Expand Down

0 comments on commit 5261acc

Please sign in to comment.