From 29b83fade46dd509e5ec79935a718e304c007f78 Mon Sep 17 00:00:00 2001 From: Daniel Ramsay Date: Tue, 11 May 2021 19:27:33 +0100 Subject: [PATCH] fix result count openrightsgroup/Blocking-Middleware#140 --- BlockedFrontend/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BlockedFrontend/registry.py b/BlockedFrontend/registry.py index ba9b5be..cbac9a9 100644 --- a/BlockedFrontend/registry.py +++ b/BlockedFrontend/registry.py @@ -22,7 +22,8 @@ def registry_seizures(page=1): res = NORM.Query(g.conn, "select count(distinct urlid), max(created) from public.url_latest_status " - "where blocktype = 'SUSPENSION'", + "left join public.url_hierarchy h using (urlid) " + "where blocktype = 'SUSPENSION' and (parent_urlid = h.urlid or h.urlid is null) ", []) row = res.fetchone() (count, newdate) = row