Skip to content

Commit

Permalink
Updated tests for new reminder container functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
pint-sized committed May 13, 2024
1 parent a09c6db commit aa186f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion taskbridge/reminders/model/reminder.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ def upsert_remote(self, container: model.ReminderContainer) -> tuple[bool, str]:
return True, 'Remote reminder added: {}'.format(self.name)
else:
# Update existing remote task
due_date = self.__get_task_due_date()
success, data = self.__get_task_due_date()
if not success:
return success, data
due_date = data

if not self.remind_me_date:
alarm_trigger = None
Expand Down
4 changes: 3 additions & 1 deletion taskbridge/reminders/model/remindercontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def persist_containers() -> tuple[bool, str]:
containers = []
for container in ReminderContainer.CONTAINER_LIST:
containers.append((
container.local_list.name,
container.local_list.name if container.local_list else '',
container.remote_calendar.name if container.remote_calendar else '',
1 if container.sync else 0
))
Expand Down Expand Up @@ -744,6 +744,8 @@ def sync_reminder_deletions(fail: str = None) -> tuple[bool, str] | tuple[bool,
return True, result

for container in ReminderContainer.CONTAINER_LIST:
if container.local_list is None or container.remote_calendar is None:
continue
container_saved_local = [r for r in saved_reminders if r['local_container'] == container.local_list.name]
container_saved_remote = [r for r in saved_reminders if
r['remote_container'] == container.remote_calendar.name]
Expand Down

0 comments on commit aa186f3

Please sign in to comment.