Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Ftrack: Ignore save warnings exception in Prepare project action #2150

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from avalon.api import AvalonMongoDB
from openpype.api import ProjectSettings
from openpype.lib import create_project
from openpype.settings import SaveWarningExc

from openpype_modules.ftrack.lib import (
ServerAction,
Expand Down Expand Up @@ -312,7 +313,6 @@ def launch(self, session, entities, event):
if not in_data:
return


root_values = {}
root_key = "__root__"
for key in tuple(in_data.keys()):
Expand Down Expand Up @@ -392,7 +392,12 @@ def launch(self, session, entities, event):
else:
attributes_entity[key] = value

project_settings.save()
try:
project_settings.save()
except SaveWarningExc as exc:
self.log.info("Few warnings happened during settings save:")
for warning in exc.warnings:
self.log.info(str(warning))

# Change custom attributes on project
if custom_attribute_values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from avalon.api import AvalonMongoDB
from openpype.api import ProjectSettings
from openpype.lib import create_project
from openpype.settings import SaveWarningExc

from openpype_modules.ftrack.lib import (
BaseAction,
Expand Down Expand Up @@ -417,7 +418,12 @@ def launch(self, session, entities, event):
else:
attributes_entity[key] = value

project_settings.save()
try:
project_settings.save()
except SaveWarningExc as exc:
self.log.info("Few warnings happened during settings save:")
for warning in exc.warnings:
self.log.info(str(warning))

# Change custom attributes on project
if custom_attribute_values:
Expand Down