error message modified

This commit is contained in:
yash-pal1 2023-10-10 19:07:51 +05:30
parent fc616301e9
commit ade0eda9e0

View File

@ -526,9 +526,9 @@ 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 needs to be assign an IPAddress") raise forms.ValidationError(f"Device is not assigned to this {ip_address}")
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 needs to be assign an IPAddress") raise forms.ValidationError(f"Virtual Machine is not assigned to this {ip_address}")
return self.cleaned_data return self.cleaned_data