From 7560f26eb78e816d1d21924721114333e21fc4ef Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 3 Oct 2011 13:52:22 +0200 Subject: [PATCH] Fix the MOVE request (related to #587) --- radicale/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index c50e659..f65652f 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -341,8 +341,10 @@ class Application(object): # Move the item to_url_parts = urlparse(environ["HTTP_DESTINATION"]) if to_url_parts.netloc == environ["HTTP_HOST"]: - to_path, to_name = posixpath.split(to_url_parts.path) - to_calendar = ical.Calendar.from_path(to_path) + to_url = to_url_parts.path + to_path, to_name = to_url.rstrip("/").rsplit("/", 1) + to_calendar = ical.Calendar.from_path( + to_path, depth="0")[0] to_calendar.append(to_name, item.text) from_calendar.remove(from_name) return client.CREATED, {}, None