From d4c545f6e4930046a0b43aeee3039c212c3a9bb5 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Thu, 28 May 2026 22:07:26 +0200 Subject: [PATCH] sharing/bday/template: store in "Actions" --- radicale/sharing/__init__.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/radicale/sharing/__init__.py b/radicale/sharing/__init__.py index 3a21c53c..db190a11 100644 --- a/radicale/sharing/__init__.py +++ b/radicale/sharing/__init__.py @@ -407,6 +407,42 @@ class BaseSharing: else: logger.trace("sharing/map: not active") + if share is not None: + if share['Conversion'] == "bday": + # autogenerate Actions if not existing + if share['Actions'] is None: + share['Actions'] = { + 'template': { + 'conversion_bday_summary_template': self.conversion_bday_summary_template, + 'conversion_bday_description_template': self.conversion_bday_description_template, + } + } + elif 'template' in share['Actions']: + if 'conversion_bday_summary_template' in share['Actions']['template']: + # nothing to do + pass + else: + share['Actions']['template'].update( + {'conversion_bday_summary_template': self.conversion_bday_summary_template} + ) + if 'conversion_bday_description_template' in share['Actions']['template']: + # nothing to do + pass + else: + share['Actions']['template'].update( + {'conversion_bday_description_template': self.conversion_bday_summary_template} + ) + else: + share['Actions'].update( + {'template': { + 'conversion_bday_summary_template': self.conversion_bday_summary_template, + 'conversion_bday_description_template': self.conversion_bday_description_template, + } + } + ) + + logger.info("sharing/%s: resolved path %r->%r, user %r->%r, Permissions=%r Conversion=%r Actions=%r", share['ShareType'], share['PathOrToken'], share['PathMapped'], user, share['Owner'], share['Permissions'], share['Conversion'], share['Actions']) + return share # adjust a share