Merge branch 'improved-broken-vcard-handling' of https://github.com/pbiering/Radicale into pbiering-improved-broken-vcard-handling

This commit is contained in:
Guillaume Ayoub 2017-02-26 16:35:44 +01:00
commit 6b683477cb
3 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,8 @@
BEGIN:VCARD
VERSION:3.0
PRODID:-//Inverse inc.//SOGo Connector 1.0//EN
UID:C68582D2-2E60-0001-C2C0-000000000000.vcf
X-MOZILLA-HTML:FALSE
EMAIL;TYPE=work:test-misses-N-or-FN@example.com
X-RADICALE-NAME:C68582D2-2E60-0001-C2C0-000000000000.vcf
END:VCARD

View File

@ -0,0 +1,15 @@
BEGIN:VCALENDAR
PRODID:-//Radicale//NONSGML Radicale Server//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20160725T060147Z
LAST-MODIFIED:20160727T193435Z
DTSTAMP:20160727T193435Z
UID:040000008200E00074C5B7101A82E00800000000
SUMMARY:Broken ICS END of VEVENT missing by accident
STATUS:CONFIRMED
X-MOZ-LASTACK:20160727T193435Z
DTSTART;TZID=Europe/Budapest:20160727T170000
DTEND;TZID=Europe/Budapest:20160727T223000
CLASS:PUBLIC
X-LIC-ERROR:No value for LOCATION property. Removing entire property:

View File

@ -28,6 +28,7 @@ in them for XML requests (all but PUT).
import posixpath import posixpath
import re import re
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from pprint import pprint
from collections import OrderedDict from collections import OrderedDict
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from http import client from http import client
@ -552,7 +553,8 @@ def propfind(base_prefix, path, xml_request, read_collections,
else: else:
response = _propfind_response( response = _propfind_response(
base_prefix, path, collection, props, user, write=True) base_prefix, path, collection, props, user, write=True)
multistatus.append(response) if response:
multistatus.append(response)
for collection in read_collections: for collection in read_collections:
if collection in collections: if collection in collections:
continue continue
@ -563,7 +565,8 @@ def propfind(base_prefix, path, xml_request, read_collections,
else: else:
response = _propfind_response( response = _propfind_response(
base_prefix, path, collection, props, user, write=False) base_prefix, path, collection, props, user, write=False)
multistatus.append(response) if response:
multistatus.append(response)
return client.MULTI_STATUS, _pretty_xml(multistatus) return client.MULTI_STATUS, _pretty_xml(multistatus)