From 56e53b33453598817932f794e8fea2bcddb3056d Mon Sep 17 00:00:00 2001 From: Raphael Matto Date: Mon, 11 Apr 2016 15:54:48 -0400 Subject: [PATCH] For #35626, error handing on entity creation. --- python/tk_multi_importcut/edl_cut.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/tk_multi_importcut/edl_cut.py b/python/tk_multi_importcut/edl_cut.py index f9b39bb8..19dd4d88 100644 --- a/python/tk_multi_importcut/edl_cut.py +++ b/python/tk_multi_importcut/edl_cut.py @@ -379,8 +379,12 @@ def create_entity(self, create_playload): :param create_payload: A list containing an entity type to be created along with paramater values the user entered in the create_entity dialog. """ - new_entity = self._sg.create(*create_playload) - self.retrieve_cuts(new_entity) + try: + new_entity = self._sg.create(*create_playload) + self.retrieve_cuts(new_entity) + except Exception, e: + self._logger.error("You do not have permission to create new %ss. \ +Please select another %s or ask your Shotgun Admin to adjust your permissions in Shotgun." % (create_playload[0], create_playload[0])) @QtCore.Slot(dict) def retrieve_cuts(self, sg_entity):