mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-10 09:38:15 -06:00
Added check in views.py to bypass the log messages if the status is success and message is None.
Fixed issue related to edit script ("AttributeError: 'dict' object has no attribute 'append'")
This commit is contained in:
parent
fdad59c8cc
commit
2b3f2b1147
@ -118,9 +118,7 @@ def handle_changed_object(sender, instance, **kwargs):
|
|||||||
|
|
||||||
@receiver(pre_delete)
|
@receiver(pre_delete)
|
||||||
def handle_deleted_object(sender, instance, **kwargs):
|
def handle_deleted_object(sender, instance, **kwargs):
|
||||||
"""
|
"""Fires when an object is deleted."""
|
||||||
Fires when an object is deleted.
|
|
||||||
"""
|
|
||||||
# Run any deletion protection rules for the object. Note that this must occur prior
|
# Run any deletion protection rules for the object. Note that this must occur prior
|
||||||
# to queueing any events for the object being deleted, in case a validation error is
|
# to queueing any events for the object being deleted, in case a validation error is
|
||||||
# raised, causing the deletion to fail.
|
# raised, causing the deletion to fail.
|
||||||
|
@ -1195,6 +1195,7 @@ class ScriptResultView(TableMixin, generic.ObjectView):
|
|||||||
tests = job.data['tests']
|
tests = job.data['tests']
|
||||||
|
|
||||||
for log in job.data['log']:
|
for log in job.data['log']:
|
||||||
|
print(log)
|
||||||
index += 1
|
index += 1
|
||||||
result = {
|
result = {
|
||||||
'index': index,
|
'index': index,
|
||||||
@ -1214,6 +1215,8 @@ class ScriptResultView(TableMixin, generic.ObjectView):
|
|||||||
for method, test_data in tests.items():
|
for method, test_data in tests.items():
|
||||||
if 'log' in test_data:
|
if 'log' in test_data:
|
||||||
for time, status, obj, url, message in test_data['log']:
|
for time, status, obj, url, message in test_data['log']:
|
||||||
|
if status == 'success' and message == 'None':
|
||||||
|
continue
|
||||||
index += 1
|
index += 1
|
||||||
result = {
|
result = {
|
||||||
'index': index,
|
'index': index,
|
||||||
|
Loading…
Reference in New Issue
Block a user