mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 08:46:10 -06:00
10719 fix regression
This commit is contained in:
parent
830a82fa7e
commit
766e9ff31b
@ -932,18 +932,19 @@ class FHRPGroupEditView(generic.ObjectEditView):
|
|||||||
return return_url
|
return return_url
|
||||||
|
|
||||||
def save_related_data(self, request, form, obj):
|
def save_related_data(self, request, form, obj):
|
||||||
ipaddress = IPAddress(
|
if form.cleaned_data.get('ip_address'):
|
||||||
vrf=form.cleaned_data['ip_vrf'],
|
ipaddress = IPAddress(
|
||||||
address=form.cleaned_data['ip_address'],
|
vrf=form.cleaned_data['ip_vrf'],
|
||||||
status=form.cleaned_data['ip_status'],
|
address=form.cleaned_data['ip_address'],
|
||||||
role=FHRP_PROTOCOL_ROLE_MAPPINGS.get(form.cleaned_data['protocol'], IPAddressRoleChoices.ROLE_VIP),
|
status=form.cleaned_data['ip_status'],
|
||||||
assigned_object=obj
|
role=FHRP_PROTOCOL_ROLE_MAPPINGS.get(form.cleaned_data['protocol'], IPAddressRoleChoices.ROLE_VIP),
|
||||||
)
|
assigned_object=obj
|
||||||
ipaddress.save()
|
)
|
||||||
|
ipaddress.save()
|
||||||
|
|
||||||
# Check that the new IPAddress conforms with any assigned object-level permissions
|
# Check that the new IPAddress conforms with any assigned object-level permissions
|
||||||
if not IPAddress.objects.restrict(request.user, 'add').filter(pk=ipaddress.pk).first():
|
if not IPAddress.objects.restrict(request.user, 'add').filter(pk=ipaddress.pk).first():
|
||||||
raise PermissionsViolation()
|
raise PermissionsViolation()
|
||||||
|
|
||||||
|
|
||||||
class FHRPGroupDeleteView(generic.ObjectDeleteView):
|
class FHRPGroupDeleteView(generic.ObjectDeleteView):
|
||||||
|
Loading…
Reference in New Issue
Block a user