ignore save warnings exception in prepare project

This commit is contained in:
iLLiCiTiT 2021-10-19 15:25:16 +02:00
parent 3c1b04a110
commit 71d79a2dc9
2 changed files with 14 additions and 3 deletions

View file

@ -3,6 +3,7 @@ import json
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,
@ -312,7 +313,6 @@ class PrepareProjectServer(ServerAction):
if not in_data:
return
root_values = {}
root_key = "__root__"
for key in tuple(in_data.keys()):
@ -392,7 +392,12 @@ class PrepareProjectServer(ServerAction):
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:

View file

@ -3,6 +3,7 @@ import json
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,
@ -417,7 +418,12 @@ class PrepareProjectLocal(BaseAction):
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: