From 159adaba94931d34a5a6d2538648f6ee68145b64 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 6 Aug 2022 09:32:22 +0200 Subject: [PATCH] Hide EmojiReact from inbox --- app/admin.py | 12 +++++++++++- app/templates.py | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/admin.py b/app/admin.py index 6fb8906..ad51f7a 100644 --- a/app/admin.py +++ b/app/admin.py @@ -300,7 +300,17 @@ async def admin_inbox( ) -> templates.TemplateResponse: where = [ models.InboxObject.ap_type.not_in( - ["Accept", "Delete", "Create", "Update", "Undo", "Read", "Add", "Remove"] + [ + "Accept", + "Delete", + "Create", + "Update", + "Undo", + "Read", + "Add", + "Remove", + "EmojiReact", + ] ), models.InboxObject.is_deleted.is_(False), models.InboxObject.is_transient.is_(False), diff --git a/app/templates.py b/app/templates.py index 30af066..381df8f 100644 --- a/app/templates.py +++ b/app/templates.py @@ -88,8 +88,11 @@ async def render_template( db_session: AsyncSession, request: Request, template: str, - template_args: dict[str, Any] = {}, + template_args: dict[str, Any] | None = None, ) -> TemplateResponse: + if template_args is None: + template_args = {} + is_admin = False is_admin = is_current_user_admin(request)