From f37c3a0b2724f5898aaffce92ab3b237101bbb2a Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 23 Feb 2012 16:16:14 +0100 Subject: [PATCH] Let GET requests create address books too! --- radicale/__init__.py | 1 + radicale/ical.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index e4c407e..894daff 100644 --- a/radicale/__init__.py +++ b/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) diff --git a/radicale/ical.py b/radicale/ical.py index 4c67c5d..fbf2d4b 100644 --- a/radicale/ical.py +++ b/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