From 36aee8395bbfc893c8e8fd7c18a0de418b7d8497 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 19 Jun 2020 15:32:02 +0200 Subject: [PATCH] warnings visualizaion is working again --- pype/tools/pyblish_pype/model.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pype/tools/pyblish_pype/model.py b/pype/tools/pyblish_pype/model.py index b9257bfeea..203b512d12 100644 --- a/pype/tools/pyblish_pype/model.py +++ b/pype/tools/pyblish_pype/model.py @@ -490,12 +490,8 @@ class PluginModel(QtGui.QStandardItemModel): new_records = result.get("records") or [] if not has_warning: for record in new_records: - if not hasattr(record, "levelname"): - continue - - if str(record.levelname).lower() in [ - "warning", "critical", "error" - ]: + level_no = record.get("levelno") + if level_no and level_no >= 30: new_flag_states[PluginStates.HasWarning] = True break @@ -789,12 +785,8 @@ class InstanceModel(QtGui.QStandardItemModel): new_records = result.get("records") or [] if not has_warning: for record in new_records: - if not hasattr(record, "levelname"): - continue - - if str(record.levelname).lower() in [ - "warning", "critical", "error" - ]: + level_no = record.get("levelno") + if level_no and level_no >= 30: new_flag_states[InstanceStates.HasWarning] = True break