Bläddra i källkod

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.
MatthewHana 1 år sedan
förälder
incheckning
825464f102
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      radicale/app/propfind.py

+ 2 - 2
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"):