1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Remove extras_features() decorator

This commit is contained in:
jeremystretch
2022-01-19 15:16:10 -05:00
parent c7825e391c
commit cdae0c2bef
26 changed files with 58 additions and 143 deletions

View File

@@ -4,8 +4,8 @@ from django.db import models
from django.urls import reverse
from mptt.models import TreeForeignKey
from extras.utils import extras_features
from netbox.models import ChangeLoggedModel, NestedGroupModel, OrganizationalModel, PrimaryModel
from netbox.models.features import WebhooksMixin
from tenancy.choices import *
__all__ = (
@@ -16,7 +16,6 @@ __all__ = (
)
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class ContactGroup(NestedGroupModel):
"""
An arbitrary collection of Contacts.
@@ -50,7 +49,6 @@ class ContactGroup(NestedGroupModel):
return reverse('tenancy:contactgroup', args=[self.pk])
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class ContactRole(OrganizationalModel):
"""
Functional role for a Contact assigned to an object.
@@ -78,7 +76,6 @@ class ContactRole(OrganizationalModel):
return reverse('tenancy:contactrole', args=[self.pk])
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class Contact(PrimaryModel):
"""
Contact information for a particular object(s) in NetBox.
@@ -129,8 +126,7 @@ class Contact(PrimaryModel):
return reverse('tenancy:contact', args=[self.pk])
@extras_features('webhooks')
class ContactAssignment(ChangeLoggedModel):
class ContactAssignment(WebhooksMixin, ChangeLoggedModel):
content_type = models.ForeignKey(
to=ContentType,
on_delete=models.CASCADE

View File

@@ -3,7 +3,6 @@ from django.db import models
from django.urls import reverse
from mptt.models import TreeForeignKey
from extras.utils import extras_features
from netbox.models import NestedGroupModel, PrimaryModel
__all__ = (
@@ -12,7 +11,6 @@ __all__ = (
)
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class TenantGroup(NestedGroupModel):
"""
An arbitrary collection of Tenants.
@@ -45,7 +43,6 @@ class TenantGroup(NestedGroupModel):
return reverse('tenancy:tenantgroup', args=[self.pk])
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class Tenant(PrimaryModel):
"""
A Tenant represents an organization served by the NetBox owner. This is typically a customer or an internal