From eba868e8e5a4a8622a0a12d7c69627b8f5e59e53 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Wed, 7 Sep 2022 19:45:34 +0200 Subject: [PATCH] Fix admin delete in the UI --- app/admin.py | 2 +- app/templates/utils.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin.py b/app/admin.py index 46dae85..118cf4b 100644 --- a/app/admin.py +++ b/app/admin.py @@ -740,7 +740,7 @@ async def admin_object( db_session: AsyncSession = Depends(get_db_session), ) -> templates.TemplateResponse: requested_object = await boxes.get_anybox_object_by_ap_id(db_session, ap_id) - if not requested_object: + if not requested_object or requested_object.is_deleted: raise HTTPException(status_code=404) replies_tree = await boxes.get_replies_tree( diff --git a/app/templates/utils.html b/app/templates/utils.html index 246c5c8..530140c 100644 --- a/app/templates/utils.html +++ b/app/templates/utils.html @@ -99,7 +99,7 @@ {% macro admin_delete_button(ap_object) %}
{{ embed_csrf_token() }} - +