mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
Verify number of components in items
This commit is contained in:
parent
d3a90d16c3
commit
4f831de006
2 changed files with 9 additions and 2 deletions
|
@ -814,7 +814,10 @@ class Application:
|
|||
return PRECONDITION_FAILED
|
||||
|
||||
try:
|
||||
items = list(vobject.readComponents(content or ""))
|
||||
items = tuple(vobject.readComponents(content or ""))
|
||||
if not write_whole_collection and len(items) != 1:
|
||||
raise RuntimeError(
|
||||
"Content contains %d components" % len(items))
|
||||
for i in items:
|
||||
storage.check_and_sanitize_item(
|
||||
i, is_collection=write_whole_collection, uid=item.uid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue