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

Fixes #4775: Allow selecting an alternate device type when creating component templates

This commit is contained in:
Jeremy Stretch
2020-06-18 11:59:24 -04:00
parent 0800279325
commit c5dc075fb0
3 changed files with 38 additions and 56 deletions

View File

@@ -950,6 +950,10 @@ class ComponentCreateView(GetReturnURLMixin, View):
))
if '_addanother' in request.POST:
return redirect(request.get_full_path())
elif 'device_type' in form.cleaned_data:
return redirect(form.cleaned_data['device_type'].get_absolute_url())
elif 'device' in form.cleaned_data:
return redirect(form.cleaned_data['device'].get_absolute_url())
else:
return redirect(self.get_return_url(request))