From 4104397f22f7308fa13ba14605102abf981b561f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Sun, 21 Jun 2020 15:53:24 +0200 Subject: [PATCH] fixed logging gui variables --- pype/modules/logging/gui/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pype/modules/logging/gui/models.py b/pype/modules/logging/gui/models.py index 945b76152b..ce1fa236a9 100644 --- a/pype/modules/logging/gui/models.py +++ b/pype/modules/logging/gui/models.py @@ -1,7 +1,7 @@ import collections from Qt import QtCore from pype.api import Logger -from pypeapp.lib.log import _bootstrap_mongo_log, COLLECTION +from pypeapp.lib.log import _bootstrap_mongo_log, LOG_COLLECTION_NAME log = Logger().get_logger("LogModel", "LoggingModule") @@ -40,10 +40,11 @@ class LogModel(QtCore.QAbstractItemModel): super(LogModel, self).__init__(parent) self._root_node = Node() - database = _bootstrap_mongo_log() self.dbcon = None - if COLLECTION in database.list_collection_names(): - self.dbcon = database[COLLECTION] + # Crash if connection is not possible to skip this module + database = _bootstrap_mongo_log() + if LOG_COLLECTION_NAME in database.list_collection_names(): + self.dbcon = database[LOG_COLLECTION_NAME] def add_log(self, log): node = Node(log)