debug cron
This commit is contained in:
@@ -39,8 +39,9 @@ class caldav_sync_manager(models.Model):
|
|||||||
|
|
||||||
self.a_task = data.calendar(cal_id=caldav_id["task"])
|
self.a_task = data.calendar(cal_id=caldav_id["task"])
|
||||||
|
|
||||||
def set_today_as_synced(self):
|
def set_today_as_synced(self, date):
|
||||||
o_new_manager = caldav_sync_manager()
|
o_new_manager = caldav_sync_manager()
|
||||||
|
o_new_manager.dtDate = date
|
||||||
o_new_manager.save()
|
o_new_manager.save()
|
||||||
|
|
||||||
def init_task_management(self):
|
def init_task_management(self):
|
||||||
@@ -57,12 +58,7 @@ class caldav_sync_manager(models.Model):
|
|||||||
print(f"test du mois précédant: {last_month.strftime("%d/%m/%Y")}")
|
print(f"test du mois précédant: {last_month.strftime("%d/%m/%Y")}")
|
||||||
o_caldav_sync_management = caldav_sync_manager.objects.filter(dtDate=last_month.date())
|
o_caldav_sync_management = caldav_sync_manager.objects.filter(dtDate=last_month.date())
|
||||||
if not o_caldav_sync_management.exists():
|
if not o_caldav_sync_management.exists():
|
||||||
self.copy_caldav_data(last_month)
|
self.copy_caldav_data(last_month)
|
||||||
o_new_manager = caldav_sync_manager()
|
|
||||||
o_new_manager.dtDate = last_month
|
|
||||||
o_new_manager.save()
|
|
||||||
o_new_manager.dtDate = last_month
|
|
||||||
o_new_manager.save()
|
|
||||||
print(f"synced events")
|
print(f"synced events")
|
||||||
else:
|
else:
|
||||||
print("Mois précédant: pas de copy, sync déjà fait")
|
print("Mois précédant: pas de copy, sync déjà fait")
|
||||||
@@ -101,7 +97,7 @@ class caldav_sync_manager(models.Model):
|
|||||||
summary= _title,
|
summary= _title,
|
||||||
description= _desc,
|
description= _desc,
|
||||||
)
|
)
|
||||||
self.set_today_as_synced()
|
self.set_today_as_synced(today)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user