Skip to content

Commit

Permalink
Handle dateLastActivity being empty
Browse files Browse the repository at this point in the history
a94a813
attempted to keep compatibility by providing a date_last_activity attribute despite
the dateLastActivity key no longer existing in the board JSON. I suspect the reason
it was removed is because it can sometimes be empty (ie when no activity has happened
on a board yet).

This change stops dateparser blowing up if the field is empty

Now that dateLastActivity isn't a key in the board JSON, it
  • Loading branch information
Rob Wyrobek committed Jun 23, 2017
1 parent 9ad17d5 commit 3d4a30f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion trello/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,5 @@ def get_last_activity(self):
"""
json_obj = self.client.fetch_json(
'/boards/{0}/dateLastActivity'.format(self.id))
return dateparser.parse(json_obj['_value'])
if json_obj['_value']:
return dateparser.parse(json_obj['_value'])

0 comments on commit 3d4a30f

Please sign in to comment.