Let GET requests create address books too!

This commit is contained in:
Guillaume Ayoub 2012-02-23 16:16:14 +01:00
parent 22e4e3764c
commit f37c3a0b27
2 changed files with 5 additions and 1 deletions

View File

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

View File

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