mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 16:26:09 -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
|
||||
|
||||
def save_related_data(self, request, form, obj):
|
||||
ipaddress = IPAddress(
|
||||
vrf=form.cleaned_data['ip_vrf'],
|
||||
address=form.cleaned_data['ip_address'],
|
||||
status=form.cleaned_data['ip_status'],
|
||||
role=FHRP_PROTOCOL_ROLE_MAPPINGS.get(form.cleaned_data['protocol'], IPAddressRoleChoices.ROLE_VIP),
|
||||
assigned_object=obj
|
||||
)
|
||||
ipaddress.save()
|
||||
if form.cleaned_data.get('ip_address'):
|
||||
ipaddress = IPAddress(
|
||||
vrf=form.cleaned_data['ip_vrf'],
|
||||
address=form.cleaned_data['ip_address'],
|
||||
status=form.cleaned_data['ip_status'],
|
||||
role=FHRP_PROTOCOL_ROLE_MAPPINGS.get(form.cleaned_data['protocol'], IPAddressRoleChoices.ROLE_VIP),
|
||||
assigned_object=obj
|
||||
)
|
||||
ipaddress.save()
|
||||
|
||||
# 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():
|
||||
raise PermissionsViolation()
|
||||
# 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():
|
||||
raise PermissionsViolation()
|
||||
|
||||
|
||||
class FHRPGroupDeleteView(generic.ObjectDeleteView):
|
||||
|
Loading…
Reference in New Issue
Block a user