diff --git a/openpype/modules/shotgrid/aop/patch.py b/openpype/modules/shotgrid/aop/patch.py deleted file mode 100644 index 56477f3bf9..0000000000 --- a/openpype/modules/shotgrid/aop/patch.py +++ /dev/null @@ -1,52 +0,0 @@ -from copy import copy - - -from openpype.api import Logger -from openpype.modules.shotgrid.lib import ( - credentials, - settings, - server, -) - -_LOG = Logger().get_logger("ShotgridModule.patch") - - -def _patched_projects( - self, projection=None, only_active=True -): - all_projects = list(self._prev_projects(projection, only_active)) - if ( - not credentials.get_local_login() - or not settings.filter_projects_by_login() - ): - return all_projects - try: - linked_names = _fetch_linked_project_names() or set() - return [x for x in all_projects if _upper(x["name"]) in linked_names] - except Exception as e: - print(e) - return all_projects - - -def _upper(x): - return str(x).strip().upper() - - -def _fetch_linked_project_names(): - return { - _upper(x["project_name"]) - for x in server.find_linked_projects(credentials.get_local_login()) - } - - -def patch_avalon_db(): - _LOG.debug("Run avalon patching") - try: - from avalon.api import AvalonMongoDB - if AvalonMongoDB.projects is _patched_projects: - return None - _LOG.debug("Patch Avalon.projects method") - AvalonMongoDB._prev_projects = copy(AvalonMongoDB.projects) - AvalonMongoDB.projects = _patched_projects - except Exception as e: - _LOG.error("Unable to patch avalon db {}".format(e)) diff --git a/openpype/modules/shotgrid/shotgrid_module.py b/openpype/modules/shotgrid/shotgrid_module.py index 6e0cbe987b..dcc8187194 100644 --- a/openpype/modules/shotgrid/shotgrid_module.py +++ b/openpype/modules/shotgrid/shotgrid_module.py @@ -46,10 +46,6 @@ class ShotgridModule( def tray_init(self): from .tray.shotgrid_tray import ShotgridTrayWrapper - from .aop.patch import patch_avalon_db - - patch_avalon_db() - threading.Timer(10.0, patch_avalon_db).start() self.tray_wrapper = ShotgridTrayWrapper(self) diff --git a/openpype/settings/entities/schemas/projects_schema/schema_main.json b/openpype/settings/entities/schemas/projects_schema/schema_main.json index 0ce3ddbefb..80b1baad1b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_main.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_main.json @@ -64,11 +64,10 @@ }, { "type": "schema", - }, - { "name": "schema_project_shotgrid" }, { + "type": "schema", "name": "schema_project_kitsu" }, {