From c7487d34a544a499b751fdc92b01196edef599c6 Mon Sep 17 00:00:00 2001 From: Rilele <122899461+Rilele@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:08:31 +0200 Subject: [PATCH] Fix for Radicale >= 3.2.0 --- radicale_infcloud/__init__.py | 8 +++++++- setup.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/radicale_infcloud/__init__.py b/radicale_infcloud/__init__.py index 33815fc..f890109 100644 --- a/radicale_infcloud/__init__.py +++ b/radicale_infcloud/__init__.py @@ -17,6 +17,7 @@ from http import client from radicale import httputils from radicale.web import internal +from importlib.metadata import version PLUGIN_CONFIG_SCHEMA = {"web": { "infcloud_config": { @@ -38,7 +39,12 @@ def get(self, environ, base_prefix, path, user): status, headers, answer = super().get( environ, base_prefix, path, user) if status == client.OK and path in ("/.web/", "/.web/index.html"): - answer = answer.replace(b"""\ + if version("radicale") >="3.2.0": + answer = answer.replace(b"""title="Refresh">Refresh""", + b"""title="Refresh">Refresh + InfCloud""") + else: + answer = answer.replace(b"""\