Browse Source

Let GET requests create address books too!

Guillaume Ayoub 14 năm trước cách đây
mục cha
commit
f37c3a0b27
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 1 0
      radicale/__init__.py
  2. 4 1
      radicale/ical.py

+ 1 - 0
radicale/__init__.py

@@ -305,6 +305,7 @@ class Application(object):
 
         collection = collections[0]
         item_name = xmlutils.name_from_path(environ["PATH_INFO"], collection)
+
         if item_name:
             # Get collection item
             item = collection.get_item(item_name)

+ 4 - 1
radicale/ical.py

@@ -392,7 +392,10 @@ class Collection(object):
                 try:
                     props["tag"] = open(self.path).readlines()[0][6:].rstrip()
                 except IOError:
-                    props["tag"] = "VCALENDAR"
+                    if self.path.endswith(".vcf"):
+                        props["tag"] = "VADDRESSBOOK"
+                    else:
+                        props["tag"] = "VCALENDAR"
             return props["tag"]
 
     @property