Avoid exception when deleting an item already deleted (fix bug #180)

This commit is contained in:
Guillaume Ayoub 2010-09-07 01:42:20 +02:00
parent 547c888c63
commit 873dec1d5d

View File

@ -159,12 +159,16 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
item_name = xmlutils.name_from_path(self.path) item_name = xmlutils.name_from_path(self.path)
if item_name: if item_name:
# Get calendar item # Get calendar item
items = self._calendar.timezones
item = self._calendar.get_item(item_name) item = self._calendar.get_item(item_name)
items.append(item) if item:
answer_text = ical.serialize( items = self._calendar.timezones
headers=self._calendar.headers, items=items) items.append(item)
etag = item.etag answer_text = ical.serialize(
headers=self._calendar.headers, items=items)
etag = item.etag
else:
self.send_response(client.GONE)
return
else: else:
# Get whole calendar # Get whole calendar
answer_text = self._calendar.text answer_text = self._calendar.text