Various fixes

This commit is contained in:
2026-04-08 22:09:51 +02:00
parent 149a488795
commit 6bd9119093
13 changed files with 1613 additions and 152 deletions

View File

@@ -1,9 +1,12 @@
from django.core.management.base import NoArgsCommand
from eventplanner_gcal.google_sync import deleteAllGCalEvents
from django.core.management.base import BaseCommand
class Command(NoArgsCommand):
from eventplanner_gcal.google_sync import delete_all_gcal_events
class Command(BaseCommand):
help = 'Delete all events in the google calendar created by this app'
def handle_noargs(self, **options):
print ("Deleting all GCal Events.")
nrOfDeletedEvents = deleteAllGCalEvents()
print ("Deleted %d events. To Restore them from local database run gcal_sync" % (nrOfDeletedEvents, ) )
def handle(self, *args, **options):
self.stdout.write('Deleting all GCal Events.')
nr_deleted = delete_all_gcal_events()
self.stdout.write(f'Deleted {nr_deleted} events. To restore them run gcal_sync')