From 7ad87670b35163ca8c5f45b6fdf03e1847fe0431 Mon Sep 17 00:00:00 2001 From: Ambulance Clerc Date: Thu, 13 Oct 2022 17:34:14 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9bug=20mycaldav?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycaldav/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mycaldav/models.py b/mycaldav/models.py index afa6b5d..01cb201 100644 --- a/mycaldav/models.py +++ b/mycaldav/models.py @@ -184,7 +184,7 @@ class cls_caldav_client(): if date is None: date = datetime.now() - tomorow = date + timedelta(days=6) + tomorow = date + timedelta(days=7) self.events = calandar.date_search( start=datetime(date.year, date.month, date.day), end=datetime(tomorow.year, tomorow.month, tomorow.day), expand=False ) @@ -200,7 +200,7 @@ class cls_caldav_client(): team_1 = "" team_2 = "" updated = False - print(f"check équipage({key[0]}) {key[1]}") + print(f"{event.vobject_instance.vevent.dtstart.value} check équipage({key[0]}) {key[1]}") if "MC" not in equipage[0]: # check équipage 1 team_1 = equipage[0].strip().replace('#', '') try: @@ -211,6 +211,8 @@ class cls_caldav_client(): except : print(f"Error: mc{team_1}@clerc.ch @{summary}") return None + else: + print("Already with MC") if "MC" not in equipage[1]: # check équipage 2 team_2 = equipage[1].strip().replace('#','') try: @@ -221,6 +223,8 @@ class cls_caldav_client(): except : print(f"Error: mc{team_2}@clerc.ch @{summary}") return None + else: + print("Already with MC") if updated: event.vobject_instance.vevent.summary.value = f"{key[0]} - {equipage[0].strip()} & {equipage[1].strip()}"