diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py
index 98665a7a0..3cd423426 100644
--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -11,7 +11,7 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.html import escape
from django.utils.safestring import mark_safe
-from django.utils.translation import gettext as _
+from django.utils.translation import gettext_lazy as _
from django.views.generic import View
from jinja2.exceptions import TemplateError
diff --git a/netbox/extras/views.py b/netbox/extras/views.py
index 321842260..0d98b1324 100644
--- a/netbox/extras/views.py
+++ b/netbox/extras/views.py
@@ -1180,7 +1180,8 @@ class ScriptView(BaseScriptView):
data=form.cleaned_data,
request=copy_safe_request(request),
job_timeout=script.python_class.job_timeout,
- commit=form.cleaned_data.pop('_commit')
+ commit=form.cleaned_data.pop('_commit'),
+ name=script.name
)
return redirect('extras:script_result', job_pk=job.pk)
diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py
index 5381ec187..b712ef3b6 100644
--- a/netbox/ipam/views.py
+++ b/netbox/ipam/views.py
@@ -3,7 +3,7 @@ from django.db.models import Prefetch
from django.db.models.expressions import RawSQL
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
-from django.utils.translation import gettext as _
+from django.utils.translation import gettext_lazy as _
from circuits.models import Provider
from dcim.filtersets import InterfaceFilterSet
diff --git a/netbox/netbox/views/generic/feature_views.py b/netbox/netbox/views/generic/feature_views.py
index 451c9c01d..49862e83f 100644
--- a/netbox/netbox/views/generic/feature_views.py
+++ b/netbox/netbox/views/generic/feature_views.py
@@ -4,7 +4,7 @@ from django.contrib import messages
from django.db import transaction
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render
-from django.utils.translation import gettext as _
+from django.utils.translation import gettext_lazy as _
from django.views.generic import View
from core.models import Job, ObjectChange
diff --git a/netbox/templates/extras/script_list.html b/netbox/templates/extras/script_list.html
index 5b7361a12..cbffbf8de 100644
--- a/netbox/templates/extras/script_list.html
+++ b/netbox/templates/extras/script_list.html
@@ -37,101 +37,104 @@
{% endif %}
- {% if module.scripts %}
-
-
-
- {% trans "Name" %} |
- {% trans "Description" %} |
- {% trans "Last Run" %} |
- {% trans "Status" %} |
- |
-
-
-
- {% for script in module.scripts.all %}
- {% with last_job=script.get_latest_jobs|first %}
-
-
- {% if script.is_executable %}
- {{ script.python_class.name }}
+ {% with scripts=module.scripts.all %}
+ {% if scripts %}
+
+
+
+ {% trans "Name" %} |
+ {% trans "Description" %} |
+ {% trans "Last Run" %} |
+ {% trans "Status" %} |
+ |
+
+
+
+ {% for script in scripts %}
+ {% with last_job=script.get_latest_jobs|first %}
+
+
+ {% if script.is_executable %}
+ {{ script.python_class.name }}
+ {% else %}
+ {{ script.python_class.name }}
+
+
+
+ {% endif %}
+ |
+ {{ script.python_class.Meta.description|markdown|placeholder }} |
+ {% if last_job %}
+
+ {{ last_job.created|isodatetime }}
+ |
+
+ {% badge last_job.get_status_display last_job.get_status_color %}
+ |
{% else %}
- {{ script.python_class.name }}
-
-
-
+ {% trans "Never" %} |
+ {{ ''|placeholder }} |
{% endif %}
-
- {{ script.python_class.Meta.description|markdown|placeholder }} |
+
+ {% if request.user|can_run:script and script.is_executable %}
+
+
+
+ {% endif %}
+ |
+
{% if last_job %}
-
- {{ last_job.created|isodatetime }}
- |
-
- {% badge last_job.get_status_display last_job.get_status_color %}
- |
- {% else %}
- {% trans "Never" %} |
- {{ ''|placeholder }} |
+ {% for test_name, data in last_job.data.tests.items %}
+
+
+ {{ test_name }}
+ |
+
+ {{ data.success }}
+ {{ data.info }}
+ {{ data.warning }}
+ {{ data.failure }}
+ |
+
+ {% endfor %}
+ {% elif not last_job.data.log %}
+ {# legacy #}
+ {% for method, stats in last_job.data.items %}
+
+
+ {{ method }}
+ |
+
+ {{ stats.success }}
+ {{ stats.info }}
+ {{ stats.warning }}
+ {{ stats.failure }}
+ |
+
+ {% endfor %}
{% endif %}
-
- {% if request.user|can_run:script and script.is_executable %}
-
-
-
- {% endif %}
- |
-
- {% if last_job %}
- {% for test_name, data in last_job.data.tests.items %}
-
-
- {{ test_name }}
- |
-
- {{ data.success }}
- {{ data.info }}
- {{ data.warning }}
- {{ data.failure }}
- |
-
- {% endfor %}
- {% elif not last_job.data.log %}
- {# legacy #}
- {% for method, stats in last_job.data.items %}
-
-
- {{ method }}
- |
-
- {{ stats.success }}
- {{ stats.info }}
- {{ stats.warning }}
- {{ stats.failure }}
- |
-
- {% endfor %}
- {% endif %}
- {% endwith %}
- {% endfor %}
-
-
- {% else %}
-
-
- Could not load scripts from {{ module.name }}
+ {% endwith %}
+ {% endfor %}
+ |
+
+ {% else %}
+
+
+
+ {% blocktrans with module=module.name %}Could not load scripts from module {{ module }}{% endblocktrans %}
+
-
- {% endif %}
+ {% endif %}
+ {% endwith %}
{% empty %}
diff --git a/netbox/tenancy/views.py b/netbox/tenancy/views.py
index 12bf4baab..96b2cb071 100644
--- a/netbox/tenancy/views.py
+++ b/netbox/tenancy/views.py
@@ -1,6 +1,6 @@
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404
-from django.utils.translation import gettext as _
+from django.utils.translation import gettext_lazy as _
from netbox.views import generic
from utilities.query import count_related
diff --git a/netbox/translations/en/LC_MESSAGES/django.po b/netbox/translations/en/LC_MESSAGES/django.po
index 35a1fae7a..7692853f4 100644
--- a/netbox/translations/en/LC_MESSAGES/django.po
+++ b/netbox/translations/en/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-10-28 19:20+0000\n"
+"POT-Creation-Date: 2024-10-29 21:00+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
diff --git a/netbox/virtualization/views.py b/netbox/virtualization/views.py
index 0828d3a2a..d1d65b1ff 100644
--- a/netbox/virtualization/views.py
+++ b/netbox/virtualization/views.py
@@ -6,7 +6,7 @@ from django.db.models import Prefetch, Sum
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
-from django.utils.translation import gettext as _
+from django.utils.translation import gettext_lazy as _
from django.views.generic.base import RedirectView
from jinja2.exceptions import TemplateError