Fix Reminder KeyError: 'description' (#247)

This commit is contained in:
Quentame 2020-03-20 19:14:43 +01:00 committed by GitHub
parent f69833637c
commit aa24871e53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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