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']:
|
if reminder['pGuid'] != collection['guid']:
|
||||||
continue
|
continue
|
||||||
if 'dueDate' in reminder:
|
|
||||||
if reminder['dueDate']:
|
if reminder.get('dueDate'):
|
||||||
due = datetime(
|
due = datetime(
|
||||||
reminder['dueDate'][1],
|
reminder['dueDate'][1],
|
||||||
reminder['dueDate'][2], reminder['dueDate'][3],
|
reminder['dueDate'][2],
|
||||||
reminder['dueDate'][4], reminder['dueDate'][5]
|
reminder['dueDate'][3],
|
||||||
|
reminder['dueDate'][4],
|
||||||
|
reminder['dueDate'][5]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
due = None
|
due = None
|
||||||
else:
|
|
||||||
due = None
|
|
||||||
if reminder['description']:
|
|
||||||
desc = reminder['description']
|
|
||||||
else:
|
|
||||||
desc = ""
|
|
||||||
temp.append({
|
temp.append({
|
||||||
"title": reminder['title'],
|
"title": reminder['title'],
|
||||||
"desc": desc,
|
"desc": reminder.get('description'),
|
||||||
"due": due
|
"due": due
|
||||||
})
|
})
|
||||||
self.lists[collection['title']] = temp
|
self.lists[collection['title']] = temp
|
||||||
|
|
Loading…
Reference in a new issue