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']: 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