diff --git a/CHANGELOG.md b/CHANGELOG.md index 30fcca532..074de88d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,15 @@ context data may observe a performance drop when returning multiple objects. To Config Context is not needed, the query parameter `?exclude=config_context` may be added to the request as to remove the Config Context from being included in any results. +### Tag Permissions Changed + +NetBox now makes use of its own `Tag` model instead of the vanilla model which ships with django-taggit. This new model lives in the `extras` app and thus any permissions that you may have configured using "Taggit | Tag" should be changed to now use "Extras | Tag." + ## Enhancements * [#2324](https://github.com/digitalocean/netbox/issues/2324) - Add color option for tags * [#2791](https://github.com/digitalocean/netbox/issues/2791) - Add a comment field for tags +* [#2926](https://github.com/digitalocean/netbox/issues/2926) - Add changelog to the Tag model --- diff --git a/netbox/extras/models.py b/netbox/extras/models.py index 285be6c44..9d907c84e 100644 --- a/netbox/extras/models.py +++ b/netbox/extras/models.py @@ -881,6 +881,9 @@ class Tag(TagBase, ChangeLoggedModel): default='' ) + def get_absolute_url(self): + return reverse('extras:tag', args=[self.slug]) + class TaggedItem(GenericTaggedItemBase): tag = models.ForeignKey( diff --git a/netbox/extras/tables.py b/netbox/extras/tables.py index e646ad821..d1454db4f 100644 --- a/netbox/extras/tables.py +++ b/netbox/extras/tables.py @@ -5,6 +5,9 @@ from utilities.tables import BaseTable, BooleanColumn, ColorColumn, ToggleColumn from .models import ConfigContext, ObjectChange, Tag, TaggedItem TAG_ACTIONS = """ + + + {% if perms.taggit.change_tag %} {% endif %} diff --git a/netbox/extras/urls.py b/netbox/extras/urls.py index 35a6fb110..d475ab5a3 100644 --- a/netbox/extras/urls.py +++ b/netbox/extras/urls.py @@ -1,6 +1,8 @@ from django.conf.urls import url from extras import views +from extras.models import Tag + app_name = 'extras' urlpatterns = [ @@ -11,6 +13,7 @@ urlpatterns = [ url(r'^tags/(?P[\w-]+)/$', views.TagView.as_view(), name='tag'), url(r'^tags/(?P[\w-]+)/edit/$', views.TagEditView.as_view(), name='tag_edit'), url(r'^tags/(?P[\w-]+)/delete/$', views.TagDeleteView.as_view(), name='tag_delete'), + url(r'^tags/(?P[\w-]+)/changelog/$', views.ObjectChangeLogView.as_view(), name='tag_changelog', kwargs={'model': Tag}), # Config contexts url(r'^config-contexts/$', views.ConfigContextListView.as_view(), name='configcontext_list'), diff --git a/netbox/templates/extras/tag.html b/netbox/templates/extras/tag.html index 49e67c395..c8bd8442a 100644 --- a/netbox/templates/extras/tag.html +++ b/netbox/templates/extras/tag.html @@ -31,6 +31,15 @@ {% endif %}

{% block title %}Tag: {{ tag }}{% endblock %}

+ {% include 'inc/created_updated.html' with obj=tag %} + {% endblock %} {% block content %}