From 81c596eb1d007bd86840c6815b9222560bb177ff Mon Sep 17 00:00:00 2001 From: Unrud Date: Wed, 6 Sep 2017 00:23:09 +0200 Subject: [PATCH] Use X-WR-CALNAME and X-WR-CALDESC when uploading calendar --- radicale/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index fc294029..3b70c1b3 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -878,7 +878,18 @@ class Application: return BAD_REQUEST if write_whole_collection: - props = {"tag": tag} if tag else {} + props = {} + if tag: + props["tag"] = tag + if tag == "VCALENDAR" and items: + if hasattr(items[0], "x_wr_calname"): + calname = items[0].x_wr_calname.value + if calname: + props["D:displayname"] = calname + if hasattr(items[0], "x_wr_caldesc"): + caldesc = items[0].x_wr_caldesc.value + if caldesc: + props["C:calendar-description"] = caldesc try: storage.check_and_sanitize_props(props) new_item = self.Collection.create_collection(