From 57f7a49fe8294c1b7987d8226e65a6ae9d2d8dc6 Mon Sep 17 00:00:00 2001 From: Andy Babic Date: Mon, 29 Jul 2024 12:31:06 +0100 Subject: [PATCH] Remove redundant JS injection in wagtail_hooks --- src/wagtail_bynder/wagtail_hooks.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/wagtail_bynder/wagtail_hooks.py b/src/wagtail_bynder/wagtail_hooks.py index 1a91988..df00d8c 100644 --- a/src/wagtail_bynder/wagtail_hooks.py +++ b/src/wagtail_bynder/wagtail_hooks.py @@ -1,6 +1,5 @@ from django.conf import settings from django.templatetags.static import static -from django.urls import reverse from django.utils.html import format_html from wagtail import hooks from wagtail.admin.menu import MenuItem @@ -50,17 +49,11 @@ def hide_image_and_document_summary_items(request, summary_items): @hooks.register("insert_editor_js") def editor_js(): - if model := get_video_model(): + if get_video_model(): return format_html( """ - - + """, - reverse( - f"{model.snippet_viewset.get_chooser_admin_url_namespace()}:choose" - ), static("bynder/js/video-chooser-modal.js"), )