added warning message on ftrack url change

This commit is contained in:
iLLiCiTiT 2021-05-04 10:42:34 +02:00
parent 2e5f014788
commit 874479fde8

View file

@ -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