Fix Reminder KeyError: 'description' (#247)
This commit is contained in:
parent
f69833637c
commit
aa24871e53
1 changed files with 11 additions and 14 deletions
|
@ -45,24 +45,21 @@ class RemindersService(object):
|
|||
|
||||
if reminder['pGuid'] != collection['guid']:
|
||||
continue
|
||||
if 'dueDate' in reminder:
|
||||
if reminder['dueDate']:
|
||||
due = datetime(
|
||||
reminder['dueDate'][1],
|
||||
reminder['dueDate'][2], reminder['dueDate'][3],
|
||||
reminder['dueDate'][4], reminder['dueDate'][5]
|
||||
)
|
||||
else:
|
||||
due = None
|
||||
|
||||
if reminder.get('dueDate'):
|
||||
due = datetime(
|
||||
reminder['dueDate'][1],
|
||||
reminder['dueDate'][2],
|
||||
reminder['dueDate'][3],
|
||||
reminder['dueDate'][4],
|
||||
reminder['dueDate'][5]
|
||||
)
|
||||
else:
|
||||
due = None
|
||||
if reminder['description']:
|
||||
desc = reminder['description']
|
||||
else:
|
||||
desc = ""
|
||||
|
||||
temp.append({
|
||||
"title": reminder['title'],
|
||||
"desc": desc,
|
||||
"desc": reminder.get('description'),
|
||||
"due": due
|
||||
})
|
||||
self.lists[collection['title']] = temp
|
||||
|
|
Loading…
Reference in a new issue