From b05566e96f342b89f6c1e3a0d45bf4cf8a1dd79c Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 6 Dec 2019 16:22:56 -0500 Subject: [PATCH] Implement tag replication for #33 --- netbox/utilities/templatetags/buttons.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netbox/utilities/templatetags/buttons.py b/netbox/utilities/templatetags/buttons.py index d7c0998c3a6..45323d5cdb6 100644 --- a/netbox/utilities/templatetags/buttons.py +++ b/netbox/utilities/templatetags/buttons.py @@ -39,7 +39,9 @@ def clone_button(url, instance): if field_value not in (None, ''): params[field_name] = field_value - # TODO: Tag replication + # Copy tags + if hasattr(instance, 'tags'): + params['tags'] = ','.join([t.name for t in instance.tags.all()]) # Append parameters to URL param_string = '&'.join(['{}={}'.format(k, v) for k, v in params.items()])