Skip to content

Commit

Permalink
18044 enable alert for plugins in script
Browse files Browse the repository at this point in the history
  • Loading branch information
arthanson authored and jeremystretch committed Dec 2, 2024
1 parent 24b7679 commit d122c33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netbox/extras/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,14 @@ def get(self, request, **kwargs):
script_class = self._get_script_class(script)
if not script_class:
return render(request, 'extras/script.html', {
'object': script,
'script': script,
})

form = script_class.as_form(initial=normalize_querydict(request.GET))

return render(request, 'extras/script.html', {
'object': script,
'script': script,
'script_class': script_class,
'form': form,
Expand All @@ -1162,6 +1164,7 @@ def post(self, request, **kwargs):
script_class = self._get_script_class(script)
if not script_class:
return render(request, 'extras/script.html', {
'object': script,
'script': script,
})

Expand All @@ -1186,6 +1189,7 @@ def post(self, request, **kwargs):
return redirect('extras:script_result', job_pk=job.pk)

return render(request, 'extras/script.html', {
'object': script,
'script': script,
'script_class': script.python_class(),
'form': form,
Expand Down

0 comments on commit d122c33

Please sign in to comment.