From 51441ee180b207611082867743a70d5011c8eef0 Mon Sep 17 00:00:00 2001 From: mlissner Date: Fri, 20 Oct 2023 15:45:22 -0700 Subject: [PATCH] fix(admin): Only do IA work if there's IA info --- cl/search/admin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cl/search/admin.py b/cl/search/admin.py index a6dc2cf35b..f52cdfbb2f 100644 --- a/cl/search/admin.py +++ b/cl/search/admin.py @@ -182,10 +182,11 @@ def seal_documents(self, request: HttpRequest, queryset: QuerySet) -> None: rd.filepath_local.delete() # Internet Archive - url = rd.filepath_ia - r = delete_from_ia(url) - if not r.ok: - ia_failures.append(url) + if rd.filepath_ia: + url = rd.filepath_ia + r = delete_from_ia(url) + if not r.ok: + ia_failures.append(url) queryset.update( date_upload=None,