error message modified

This commit is contained in:
yash-pal1 2023-10-10 18:37:21 +05:30
parent 518ee85d9e
commit 995586458a

View File

@ -526,9 +526,11 @@ class ServiceImportForm(NetBoxModelImportForm):
for ip_address in self.cleaned_data.get('ipaddresses'): for ip_address in self.cleaned_data.get('ipaddresses'):
if device and ip_address != device.primary_ip4: if device and ip_address != device.primary_ip4:
raise forms.ValidationError("Device should assign to be an ip address") raise forms.ValidationError(
f"IP address assignment required for the device.")
if virtual_machine and ip_address != virtual_machine.primary_ip4: if virtual_machine and ip_address != virtual_machine.primary_ip4:
raise forms.ValidationError("Virtual Machine should assign to be an ip address") raise forms.ValidationError(
f"IP address assignment required for the virtual machine.")
return self.cleaned_data return self.cleaned_data