We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e404987 commit ca52b82Copy full SHA for ca52b82
validators.py
@@ -2,6 +2,7 @@
2
3
class DNSValidator(CustomValidator):
4
def validate(self, instance):
5
+ print(instance)
6
from netbox_dns.models import Record, RecordTypeChoices
7
if instance.type == RecordTypeChoices.AAAA:
8
records = Record.objects.filter(name=instance.name, zone=instance.zone, type=RecordTypeChoices.A)
@@ -22,6 +23,7 @@ def validate(self, instance):
22
23
if records.exists():
24
self.fail("Record for this name in this zone already exists!", field='name')
25
records = Record.objects.filter(name=instance.name, zone=instance.zone, type=instance.type)
26
+ print(records)
27
28
self.fail("Record of given type for this name in this zone already exists!", field='name')
29
0 commit comments