Explorar o código

Use a simpler code to detect not-created-yet addressbooks

Guillaume Ayoub %!s(int64=12) %!d(string=hai) anos
pai
achega
2cd90c6a4a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      radicale/ical.py

+ 1 - 1
radicale/ical.py

@@ -399,7 +399,7 @@ class Collection(object):
                 try:
                     tag = open(self.path).readlines()[0][6:].rstrip()
                 except IOError:
-                    if self.path.endswith(".vcf") or "carddav" in self.path:
+                    if self.path.endswith((".vcf", "/carddav")):
                         props["tag"] = "VADDRESSBOOK"
                     else:
                         props["tag"] = "VCALENDAR"