From 2cfb79ef40891149ff87ecc5158c88991e35b0ef Mon Sep 17 00:00:00 2001 From: Patrick Boos Date: Tue, 26 Aug 2014 12:14:53 +0200 Subject: [PATCH] Allow empty due dates Empty due dates on cards currently crash fetch(). This will only get the due date if it is actually set. --- trello/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trello/__init__.py b/trello/__init__.py index 89a60b59..2acc3800 100644 --- a/trello/__init__.py +++ b/trello/__init__.py @@ -553,7 +553,8 @@ def fetch(self, eager=True): self.labels = json_obj['labels'] self.badges = json_obj['badges'] # For consistency, due date is in YYYY-MM-DD format - self.due = json_obj.get('due', '')[:10] + if json_obj.get('due', ''): + self.due = json_obj.get('due', '')[:10] self.checked = json_obj['checkItemStates'] self.dateLastActivity = dateparser.parse(json_obj['dateLastActivity'])