Skip to content

Commit

Permalink
Additional type checking for getcontentcount prop
Browse files Browse the repository at this point in the history
Tests keep failing due to static type checking for condition that won't occur due to earlier checking.  Bringing checking into if statement.
  • Loading branch information
MatthewHana committed Mar 12, 2024
1 parent 2c13b8d commit 825464f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radicale/app/propfind.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 825464f

Please sign in to comment.