filter broken vcard entries before delivered, found on real life system at least 2 cards where vobject claimed about
vobject.base.ValidateError: 'VCARD components must contain at least 1 N'
This commit is contained in:
parent
0c1dbc30bd
commit
1cfd3fd95b
@ -718,7 +718,18 @@ class Collection(BaseCollection):
|
||||
break
|
||||
return collection.serialize()
|
||||
elif self.get_meta("tag") == "VADDRESSBOOK":
|
||||
return "".join([item.serialize() for item in items])
|
||||
self.logger.debug("Try to serialize VADDRESSBOOK")
|
||||
items_ok = []
|
||||
result = ""
|
||||
for item in items:
|
||||
try:
|
||||
item.serialize()
|
||||
items_ok.append(item)
|
||||
except:
|
||||
self.logger.exception("VCARD broken (skip): %s", item)
|
||||
result = "".join([item.serialize() for item in items_ok])
|
||||
self.logger.debug("Try to return VADDRESSBOOK")
|
||||
return result
|
||||
return ""
|
||||
|
||||
_lock = threading.Lock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user