From 874479fde8280f35bacb707558199ee9268f8ec6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 4 May 2021 10:42:34 +0200 Subject: [PATCH] added warning message on ftrack url change --- openpype/modules/ftrack/ftrack_module.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/openpype/modules/ftrack/ftrack_module.py b/openpype/modules/ftrack/ftrack_module.py index 0b0bbfc7e4..ee139a500e 100644 --- a/openpype/modules/ftrack/ftrack_module.py +++ b/openpype/modules/ftrack/ftrack_module.py @@ -133,10 +133,22 @@ class FtrackModule( " Can't propagate changes to Ftrack server." )) + ftrack_changes = changes.get("modules", {}).get("ftrack", {}) + url_change_msg = None + if "ftrack_server" in ftrack_changes: + url_change_msg = ( + "Ftrack URL was changed." + " This change may need to restart OpenPype to take affect." + ) + try: session = self.create_ftrack_session() except Exception: self.log.warning("Couldn't create ftrack session.", exc_info=True) + + if url_change_msg: + raise SaveWarningExc(url_change_msg) + raise SaveWarningExc(( "Saving of attributes to ftrack wasn't successful," " try running Create/Update Avalon Attributes in ftrack." @@ -210,6 +222,9 @@ class FtrackModule( " Try running Create/Update Avalon Attributes in ftrack." ).format(", ".join(missing_attributes))) + if url_change_msg: + raise SaveWarningExc(url_change_msg) + def on_project_settings_save(self, *_args, **_kwargs): """Implementation of ISettingsChangeListener interface.""" # Ignore