Merge branch 'develop' into feature

This commit is contained in:
Jeremy Stretch 2024-10-30 13:10:47 -04:00
commit 19c5c32965
8 changed files with 101 additions and 97 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -37,7 +37,8 @@
{% endif %}
</div>
</h2>
{% if module.scripts %}
{% with scripts=module.scripts.all %}
{% if scripts %}
<table class="table table-hover scripts">
<thead>
<tr>
@ -49,7 +50,7 @@
</tr>
</thead>
<tbody>
{% for script in module.scripts.all %}
{% for script in scripts %}
{% with last_job=script.get_latest_jobs|first %}
<tr>
<td>
@ -128,10 +129,12 @@
{% else %}
<div class="card-body">
<div class="alert alert-warning" role="alert">
<i class="mdi mdi-alert"></i> Could not load scripts from {{ module.name }}
<i class="mdi mdi-alert"></i>
{% blocktrans with module=module.name %}Could not load scripts from module {{ module }}{% endblocktrans %}
</div>
</div>
{% endif %}
{% endwith %}
</div>
{% empty %}
<div class="alert alert-info" role="alert">

View File

@ -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

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -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