From 825464f102bd53d263abeb73b294ac382ec12cb4 Mon Sep 17 00:00:00 2001 From: MatthewHana Date: Wed, 13 Mar 2024 02:16:16 +1100 Subject: [PATCH] Additional type checking for getcontentcount prop Tests keep failing due to static type checking for condition that won't occur due to earlier checking. Bringing checking into if statement. --- radicale/app/propfind.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/app/propfind.py b/radicale/app/propfind.py index 47773481..b1cfc197 100644 --- a/radicale/app/propfind.py +++ b/radicale/app/propfind.py @@ -274,8 +274,8 @@ def xml_propfind_response( is404 = True elif tag == xmlutils.make_clark("RADICALE:getcontentcount"): # Only for internal use by the web interface - if is_collection and not collection.is_principal: - element.text = str(sum(1 for entry in item.get_all())) + if isinstance(item, storage.BaseCollection) and not collection.is_principal: + element.text = str(sum(1 for x in item.get_all())) else: is404 = True elif tag == xmlutils.make_clark("D:displayname"):