Code Repositories xandikos / 1d9ff85
Skip calendar files that lack DTSTART entries, rather than throwing an exception. Jelmer Vernooij a month ago
1 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
5151 TRANSPARENCY_OPAQUE = 'opaque'
5252
5353
54 class MissingProperty(Exception):
55
56 def __init__(self, property_name):
57 super(MissingProperty, self).__init__(
58 "Property %r missing" % property_name)
59 self.property_name = property_name
60
61
5462 class Calendar(webdav.Collection):
5563
5664 resource_types = (webdav.Collection.resource_types +
340348
341349
342350 def apply_time_range_vevent(start, end, comp, tzify):
343 if not (end > tzify(comp['DTSTART'].dt)):
351 try:
352 start = tzify(comp['DTSTART'].dt)
353 except KeyError:
354 raise MissingProperty('DTSTART')
355
356 if not (end > start):
344357 return False
345358
346359 if 'DTEND' in comp:
562575 tzify = lambda dt: as_tz_aware_ts(dt, tz)
563576 for (href, resource) in webdav.traverse_resource(
564577 base_resource, base_href, depth):
565 if not apply_filter(filter_el, resource, tzify):
578 try:
579 filter_result = apply_filter(filter_el, resource, tzify)
580 except MissingProperty as e:
581 logging.warning(
582 'calendar_query: Ignoring calendar object %s, due '
583 'to missing property %s', href, e.property_name)
584 continue
585 if not filter_result:
566586 continue
567587 propstat = davcommon.get_properties_with_data(
568588 self.data_property, href, resource, properties, environ,