mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
12416 update from review feedback
This commit is contained in:
parent
5976d8484e
commit
364f20f620
@ -1,4 +1,5 @@
|
|||||||
import inspect
|
import inspect
|
||||||
|
import logging
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
@ -16,6 +17,8 @@ __all__ = (
|
|||||||
'ScriptModule',
|
'ScriptModule',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger = logging.getLogger('netbox.data_backends')
|
||||||
|
|
||||||
|
|
||||||
class Script(WebhooksMixin, models.Model):
|
class Script(WebhooksMixin, models.Model):
|
||||||
"""
|
"""
|
||||||
@ -56,6 +59,7 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile):
|
|||||||
try:
|
try:
|
||||||
module = self.get_module()
|
module = self.get_module()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
logger.debug(f"Failed to load script: {self.python_name} error: {e}")
|
||||||
module = None
|
module = None
|
||||||
|
|
||||||
scripts = {}
|
scripts = {}
|
||||||
|
@ -39,9 +39,7 @@
|
|||||||
{% include 'inc/sync_warning.html' with object=module %}
|
{% include 'inc/sync_warning.html' with object=module %}
|
||||||
{% if not module.scripts %}
|
{% if not module.scripts %}
|
||||||
<div class="alert alert-warning d-flex align-items-center" role="alert">
|
<div class="alert alert-warning d-flex align-items-center" role="alert">
|
||||||
<div>
|
<i class="mdi mdi-alert"></i> Script file at: {{module.full_path}} could not be loaded.
|
||||||
Warning: Script file at: <strong>{{ module.full_path }}"</strong> is either missing or has a problem with the script code, please check the file.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<table class="table table-hover table-headings reports">
|
<table class="table table-hover table-headings reports">
|
||||||
|
Loading…
Reference in New Issue
Block a user