From bca00cd97a279e5437f2e2f8ff8ec89620f97125 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Mon, 3 Apr 2023 12:27:13 -0700 Subject: [PATCH] 12117 remove clone from cable (#12130) * 12117 remove clone from cable * 12117 remove clone button if no params * Update clone.html * Update clone.html * Update clone.html --------- Co-authored-by: Jeremy Stretch --- netbox/utilities/templates/buttons/clone.html | 8 +++++--- netbox/utilities/templatetags/buttons.py | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/netbox/utilities/templates/buttons/clone.html b/netbox/utilities/templates/buttons/clone.html index 24e685c3d..8fe62a1c8 100644 --- a/netbox/utilities/templates/buttons/clone.html +++ b/netbox/utilities/templates/buttons/clone.html @@ -1,3 +1,5 @@ - -  Clone - +{% if url %} + + Clone + +{% endif %} diff --git a/netbox/utilities/templatetags/buttons.py b/netbox/utilities/templatetags/buttons.py index bcdb099d8..dbd0240b9 100644 --- a/netbox/utilities/templatetags/buttons.py +++ b/netbox/utilities/templatetags/buttons.py @@ -20,6 +20,8 @@ def clone_button(instance): param_string = prepare_cloned_fields(instance).urlencode() if param_string: url = f'{url}?{param_string}' + else: + url = None return { 'url': url,