From ae570e5907e2ba7ff3572da5bf53aff3e676a1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 4 Nov 2016 13:44:12 +0100 Subject: [PATCH] Allow undeletion of shots by relinking to the edit. --- blender_cloud/attract/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blender_cloud/attract/__init__.py b/blender_cloud/attract/__init__.py index 2297eb9..a1381ec 100644 --- a/blender_cloud/attract/__init__.py +++ b/blender_cloud/attract/__init__.py @@ -308,6 +308,11 @@ class AttractOperatorMixin: def relink(self, strip, atc_object_id, *, refresh=False): from .. import pillar + # The node may have been deleted, so we need to send a 'relink' before we try + # to fetch the node itself. + node = Node({'_id': atc_object_id}) + pillar.sync_call(node.patch, {'op': 'relink'}) + try: node = pillar.sync_call(Node.find, atc_object_id, caching=False) except (sdk_exceptions.ResourceNotFound, sdk_exceptions.MethodNotAllowed): @@ -317,7 +322,6 @@ class AttractOperatorMixin: strip.atc_is_synced = False return {'CANCELLED'} - pillar.sync_call(node.patch, {'op': 'relink'}) strip.atc_is_synced = True if not refresh: strip.atc_name = node.name @@ -433,6 +437,7 @@ class AttractShotDelete(AttractOperatorMixin, Operator): return {'CANCELLED'} remove_atc_props(strip) + compute_strip_conflicts(context) draw.tag_redraw_all_sequencer_editors() return {'FINISHED'}