mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Fix name_from_path
This commit is contained in:
parent
6a4fe6beb5
commit
21461ddb4e
1 changed files with 4 additions and 2 deletions
|
@ -429,8 +429,10 @@ def _param_filter_match(vobject_item, filter_, parent_name):
|
||||||
|
|
||||||
def name_from_path(path, collection):
|
def name_from_path(path, collection):
|
||||||
"""Return Radicale item name from ``path``."""
|
"""Return Radicale item name from ``path``."""
|
||||||
collection_parts = collection.path.strip("/").split("/")
|
collection_path = collection.path.strip("/")
|
||||||
path_parts = path.strip("/").split("/")
|
collection_parts = collection_path.split("/") if collection_path else []
|
||||||
|
path = path.strip("/")
|
||||||
|
path_parts = path.split("/") if path else []
|
||||||
if (len(path_parts) - len(collection_parts)):
|
if (len(path_parts) - len(collection_parts)):
|
||||||
return path_parts[-1]
|
return path_parts[-1]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue