[CalendarServer-changes] [106] CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/method/put_common.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 7 08:16:55 PDT 2006


Revision: 106
Author:   cdaboo at apple.com
Date:     2006-09-07 08:16:54 -0700 (Thu, 07 Sep 2006)

Log Message:
-----------
Make sure we get an appropriate exception back when we have invalid calendar data.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/method/put_common.py

Modified: CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/method/put_common.py
===================================================================
--- CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/method/put_common.py	2006-09-07 15:16:20 UTC (rev 105)
+++ CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/method/put_common.py	2006-09-07 15:16:54 UTC (rev 106)
@@ -302,7 +302,11 @@
                     # At this point we need the calendar data to do more tests
                     calendar = source.iCalendar()
                 else:
-                    calendar = Component.fromString(calendardata)
+                    try:
+                        calendar = Component.fromString(calendardata)
+                    except ValueError, e:
+                        log.err(e)
+                        raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "valid-calendar-data")))
                         
                 # Valid calendar data check
                 result, message = validCalendarDataCheck()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060907/e6199887/attachment.html


More information about the calendarserver-changes mailing list