Skip to content

Commit

Permalink
Don't error out if no due date
Browse files Browse the repository at this point in the history
  • Loading branch information
portante committed Jul 16, 2015
1 parent 66fbb59 commit b5ba124
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion trello/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit b5ba124

Please sign in to comment.