Fixes #4951: Redirect to device inventory view after creting a new inventory item

This commit is contained in:
Jeremy Stretch
2020-08-06 13:19:22 -04:00
parent 27f8a3d021
commit f48414eda5
3 changed files with 2 additions and 5 deletions

View File

@@ -1281,10 +1281,6 @@ class ComponentCreateView(GetReturnURLMixin, ObjectPermissionRequiredMixin, 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))