updated gcal coupling

This commit is contained in:
2026-04-09 16:07:23 +02:00
parent 2352dbe35a
commit 4e72586372
3 changed files with 82 additions and 6 deletions

View File

@@ -308,9 +308,7 @@ def delete_all_gcal_events(service=None):
return 0
# Use batch request for efficiency
from googleapiclient.http import BatchHttpRequest
batch = BatchHttpRequest()
batch = service.new_batch_http_request()
for gcal_id in gcal_ids:
batch.add(service.events().delete(calendarId="primary", eventId=gcal_id))
@@ -359,9 +357,7 @@ def sync_from_local_to_google(service=None):
events_to_create_django_id = local_events_django_id - events_at_google_django_id
events_to_delete_google_id = events_at_google_google_id - local_events_google_id
from googleapiclient.http import BatchHttpRequest
batch = BatchHttpRequest()
batch = service.new_batch_http_request()
batch_is_empty = True
for event_django_id in events_to_create_django_id: