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:
Julio-Oliveira-Encora 2024-06-04 11:12:38 -03:00
parent fdad59c8cc
commit 2b3f2b1147
2 changed files with 4 additions and 3 deletions

View File

@ -118,9 +118,7 @@ def handle_changed_object(sender, instance, **kwargs):
@receiver(pre_delete)
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
# to queueing any events for the object being deleted, in case a validation error is
# raised, causing the deletion to fail.

View File

@ -1195,6 +1195,7 @@ class ScriptResultView(TableMixin, generic.ObjectView):
tests = job.data['tests']
for log in job.data['log']:
print(log)
index += 1
result = {
'index': index,
@ -1214,6 +1215,8 @@ class ScriptResultView(TableMixin, generic.ObjectView):
for method, test_data in tests.items():
if 'log' in test_data:
for time, status, obj, url, message in test_data['log']:
if status == 'success' and message == 'None':
continue
index += 1
result = {
'index': index,