From b5ba124fb596dd8b8c260443ebaf2a0905337836 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Thu, 16 Jul 2015 11:04:29 -0400 Subject: [PATCH] Don't error out if no due date --- trello/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trello/__init__.py b/trello/__init__.py index 7df736cd..05c01cb4 100644 --- a/trello/__init__.py +++ b/trello/__init__.py @@ -809,6 +809,8 @@ def fetch(self, eager=True): # For consistency, due date is in YYYY-MM-DD format if json_obj.get('due', ''): self.due = json_obj.get('due', '')[:10] + else: + self.due = '' self.checked = json_obj['checkItemStates'] self.dateLastActivity = dateparser.parse(json_obj['dateLastActivity']) @@ -906,7 +908,7 @@ def create_date(self): @property def due_date(self): - return dateparser.parse(self.due) + return dateparser.parse(self.due) if self.due else '' def set_name(self, new_name): """