Skip to content

Commit 017cd6a

Browse files
committed
fix tests
1 parent dc0f6df commit 017cd6a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

validity/api/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from django.core.exceptions import ValidationError
2-
from django.db.models import ManyToManyField
32
from rest_framework.permissions import BasePermission
43
from rest_framework.relations import PrimaryKeyRelatedField
54
from rest_framework.serializers import HyperlinkedIdentityField, JSONField, ModelSerializer
@@ -82,7 +81,7 @@ class SubformValidationMixin:
8281
def _validate(self, attrs):
8382
instance = self.instance or self.Meta.model()
8483
for field, field_value in attrs.items():
85-
if not isinstance(instance._meta.get_field(field), ManyToManyField):
84+
if not instance._meta.get_field(field).many_to_many:
8685
setattr(instance, field, field_value)
8786
if not instance.subform_type:
8887
return

validity/netbox_changes/current.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# NetBox 4.6
22

3+
from pydoc import locate
34

45
from .old import *
6+
7+
8+
ChoicesType = locate("django.db.models.enums.ChoicesType")

0 commit comments

Comments
 (0)