From 19deeb9512f88fcf31f591135fcd9928ed07345d Mon Sep 17 00:00:00 2001 From: ducklet Date: Sat, 11 Feb 2023 18:32:36 +0100 Subject: [PATCH] fix matching of descendants during delete --- metadex/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadex/db.py b/metadex/db.py index 34f7d57..5f5836b 100644 --- a/metadex/db.py +++ b/metadex/db.py @@ -460,11 +460,12 @@ def remove_all( if hostname is None: hostname = config.hostname + location_dir = location if location.endswith("/") else location + "/" selector = and_( metadex.c.hostname == hostname, or_( metadex.c.location == location, - metadex.c.location.startswith(location + "/", autoescape=True), + metadex.c.location.startswith(location_dir, autoescape=True), ), ) stmt = select(metadex.c.location).where(selector)