From 091d89889d152ec2b3013a2b24f7548b53a9f30c Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 20 Dec 2010 15:49:48 +0100 Subject: [PATCH] Fix get requests for whole calendar --- radicale/__init__.py | 4 +++- radicale/xmlutils.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 2fc3f80..64b5833 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -154,7 +154,8 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler): def do_GET(self): """Manage GET request.""" self.do_HEAD() - self.wfile.write(self._answer) + if self._answer: + self.wfile.write(self._answer) @check_rights def do_HEAD(self): @@ -170,6 +171,7 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler): headers=self._calendar.headers, items=items) etag = item.etag else: + self._answer = None self.send_response(client.GONE) return else: diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 7ff759b..ddf0a7f 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -52,7 +52,8 @@ def _response(code): def name_from_path(path): """Return Radicale item name from ``path``.""" - return path.split("/")[-1] + path_parts = path.strip("/").split("/") + return path_parts[-1] if len(path_parts) > 2 else None def delete(path, calendar):