소스 검색

Implement tag replication for #33

Jeremy Stretch 6 년 전
부모
커밋
b05566e96f
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      netbox/utilities/templatetags/buttons.py

+ 3 - 1
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()])