mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-21 19:18:44 -06:00
Rename ContentType proxy model to ObjectType
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from django import forms
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from core.models import ContentType
|
||||
from core.models import ObjectType
|
||||
from netbox.forms import NetBoxModelFilterSetForm
|
||||
from tenancy.choices import *
|
||||
from tenancy.models import *
|
||||
@@ -86,7 +86,7 @@ class ContactAssignmentFilterForm(NetBoxModelFilterSetForm):
|
||||
(_('Assignment'), ('content_type_id', 'group_id', 'contact_id', 'role_id', 'priority')),
|
||||
)
|
||||
content_type_id = ContentTypeMultipleChoiceField(
|
||||
queryset=ContentType.objects.with_feature('contacts'),
|
||||
queryset=ObjectType.objects.with_feature('contacts'),
|
||||
required=False,
|
||||
label=_('Object type')
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from core.models import ContentType
|
||||
from core.models import ObjectType
|
||||
from netbox.models import ChangeLoggedModel, NestedGroupModel, OrganizationalModel, PrimaryModel
|
||||
from netbox.models.features import CustomFieldsMixin, ExportTemplatesMixin, TagsMixin
|
||||
from tenancy.choices import *
|
||||
@@ -165,7 +165,7 @@ class ContactAssignment(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin, Chan
|
||||
super().clean()
|
||||
|
||||
# Validate the assigned object type
|
||||
if self.content_type not in ContentType.objects.with_feature('contacts'):
|
||||
if self.content_type not in ObjectType.objects.with_feature('contacts'):
|
||||
raise ValidationError(
|
||||
_("Contacts cannot be assigned to this object type ({type}).").format(type=self.content_type)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user