diff --git a/mycaldav/models.py b/mycaldav/models.py index c98b385..6c0af28 100644 --- a/mycaldav/models.py +++ b/mycaldav/models.py @@ -163,7 +163,7 @@ class cls_caldav(): def convert_to_gmt1(self, dt): gmt1_tz = pytz.timezone('Europe/Paris') - if dt.tzinfo is not None: + if hasattr(dt,"tzinfo") and dt.tzinfo is not None: # Convertir l'objet datetime en GMT+1 # Utilisez le nom de votre fuseau horaire GMT+1 dt_gmt1 = dt.astimezone(gmt1_tz) @@ -269,7 +269,7 @@ class cls_caldav_client(): def init_caldav(self, caldav_url, caldav_user, caldav_password): client = caldav.DAVClient(url=caldav_url, username=caldav_user, password=caldav_password) - self.data = self.client.principal() + self.data = client.principal() for cal in self.data.calendars(): print(f"name: {cal.name}({cal.url})")