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,