mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 02:58:17 -06:00
Fix saving cable which results in resetting of the termination type fields
This commit is contained in:
parent
297ab4a9db
commit
a16564f9fc
@ -3189,9 +3189,11 @@ class CableEditView(generic.ObjectEditView):
|
||||
|
||||
# If creating a new Cable, initialize the form class using URL query params
|
||||
if 'pk' not in kwargs:
|
||||
a_terminations_type = request.POST.get('a_terminations_type') or request.GET.get('a_terminations_type')
|
||||
b_terminations_type = request.POST.get('b_terminations_type') or request.GET.get('b_terminations_type')
|
||||
self.form = forms.get_cable_form(
|
||||
a_type=CABLE_TERMINATION_TYPES.get(request.GET.get('a_terminations_type')),
|
||||
b_type=CABLE_TERMINATION_TYPES.get(request.GET.get('b_terminations_type'))
|
||||
a_type=CABLE_TERMINATION_TYPES.get(a_terminations_type),
|
||||
b_type=CABLE_TERMINATION_TYPES.get(b_terminations_type)
|
||||
)
|
||||
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user