1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fix #12579 create cable and add another error (#13007)

* fix create cable and add another error #12579

* fix return proper parent object field

* improve code and wokflow

---------

Co-authored-by: netopsab <abrisson@cerbere.rp.sig.u-bourgogne.fr>
This commit is contained in:
Anthony Brissonnet
2023-07-06 15:28:45 +02:00
committed by GitHub
parent 5f0922713f
commit 860be780ad

View File

@@ -3131,6 +3131,19 @@ class CableEditView(generic.ObjectEditView):
return obj
def get_extra_addanother_params(self, request):
params = {
'a_terminations_type': request.GET.get('a_terminations_type'),
'b_terminations_type': request.GET.get('b_terminations_type')
}
for key in request.POST:
if 'device' in key or 'power_panel' in key or 'circuit' in key:
params.update({key: request.POST.get(key)})
return params
@register_model_view(Cable, 'delete')
class CableDeleteView(generic.ObjectDeleteView):