From c136e5cb086fc7daabe77f3ab60268559a83ab78 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 13 Jul 2020 17:26:15 +0200 Subject: [PATCH] hound fixes --- .../ftrack/events/event_del_avalon_id_from_new.py | 9 +++------ pype/modules/ftrack/lib/avalon_sync.py | 4 +++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pype/modules/ftrack/events/event_del_avalon_id_from_new.py b/pype/modules/ftrack/events/event_del_avalon_id_from_new.py index 47a87e9ba5..ee82c9589d 100644 --- a/pype/modules/ftrack/events/event_del_avalon_id_from_new.py +++ b/pype/modules/ftrack/events/event_del_avalon_id_from_new.py @@ -37,12 +37,9 @@ class DelAvalonIdFromNew(BaseEvent): entity_id ) - cust_attr = ftrack_entity['custom_attributes'][ - CUST_ATTR_ID_KEY - ] - - if cust_attr != '': - ftrack_entity['custom_attributes'][CUST_ATTR_ID_KEY] = '' + cust_attrs = ftrack_entity["custom_attributes"] + if cust_attrs[CUST_ATTR_ID_KEY]: + cust_attrs[CUST_ATTR_ID_KEY] = "" session.commit() except Exception: diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index 07a1b17770..f78e617f3a 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -1124,7 +1124,9 @@ class SyncEntitiesFactory: continue _entity_dict = self.entities_dict[_ftrack_id] - _mongo_id = _entity_dict["avalon_attrs"][CUST_ATTR_ID_KEY] + _mongo_id = ( + _entity_dict["avalon_attrs"][CUST_ATTR_ID_KEY] + ) _av_ent_by_mongo_id = self.avalon_ents_by_id.get( _mongo_id )