mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-20 10:38:44 -06:00
* Enable E501 rule * Configure ruff formatter * Reformat migration files to fix line length violations * Fix various E501 errors * Move table template code to template_code.py & ignore E501 errors * Reformat raw SQL
This commit is contained in:
@@ -387,7 +387,12 @@ class IPAddressForm(TenancyForm, NetBoxModelForm):
|
||||
})
|
||||
elif selected_objects:
|
||||
assigned_object = self.cleaned_data[selected_objects[0]]
|
||||
if self.instance.pk and self.instance.assigned_object and self.cleaned_data['primary_for_parent'] and assigned_object != self.instance.assigned_object:
|
||||
if (
|
||||
self.instance.pk and
|
||||
self.instance.assigned_object and
|
||||
self.cleaned_data['primary_for_parent'] and
|
||||
assigned_object != self.instance.assigned_object
|
||||
):
|
||||
raise ValidationError(
|
||||
_("Cannot reassign IP address while it is designated as the primary IP for the parent object")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user