mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-04 21:57:43 +03:00
Fix: set PRODID on collection upload
This commit is contained in:
parent
4d04c85f2d
commit
f1d007a51e
1 changed files with 4 additions and 1 deletions
|
@ -29,7 +29,7 @@ from typing import Iterator, List, Mapping, MutableMapping, Optional, Tuple
|
||||||
import vobject
|
import vobject
|
||||||
|
|
||||||
import radicale.item as radicale_item
|
import radicale.item as radicale_item
|
||||||
from radicale import httputils, pathutils, rights, storage, types, xmlutils
|
from radicale import httputils, pathutils, rights, storage, types, xmlutils, utils
|
||||||
from radicale.app.base import Access, ApplicationBase
|
from radicale.app.base import Access, ApplicationBase
|
||||||
from radicale.hook import HookNotificationItem, HookNotificationItemTypes
|
from radicale.hook import HookNotificationItem, HookNotificationItemTypes
|
||||||
from radicale.log import logger
|
from radicale.log import logger
|
||||||
|
@ -37,6 +37,8 @@ from radicale.log import logger
|
||||||
MIMETYPE_TAGS: Mapping[str, str] = {value: key for key, value in
|
MIMETYPE_TAGS: Mapping[str, str] = {value: key for key, value in
|
||||||
xmlutils.MIMETYPES.items()}
|
xmlutils.MIMETYPES.items()}
|
||||||
|
|
||||||
|
PRODID = u"-//Radicale//NONSGML Version " + utils.package_version("radicale") + "//EN"
|
||||||
|
|
||||||
|
|
||||||
def prepare(vobject_items: List[vobject.base.Component], path: str,
|
def prepare(vobject_items: List[vobject.base.Component], path: str,
|
||||||
content_type: str, permission: bool, parent_permission: bool,
|
content_type: str, permission: bool, parent_permission: bool,
|
||||||
|
@ -80,6 +82,7 @@ def prepare(vobject_items: List[vobject.base.Component], path: str,
|
||||||
vobject_collection = vobject.iCalendar()
|
vobject_collection = vobject.iCalendar()
|
||||||
for component in components:
|
for component in components:
|
||||||
vobject_collection.add(component)
|
vobject_collection.add(component)
|
||||||
|
vobject_collection.add(vobject.base.ContentLine("PRODID", [], PRODID))
|
||||||
item = radicale_item.Item(collection_path=collection_path,
|
item = radicale_item.Item(collection_path=collection_path,
|
||||||
vobject_item=vobject_collection)
|
vobject_item=vobject_collection)
|
||||||
item.prepare()
|
item.prepare()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue