From 11234ef23c5864f2c9c18d500323e8b6a5374946 Mon Sep 17 00:00:00 2001 From: Joe Hultgren Date: Thu, 12 Dec 2019 15:04:06 -0800 Subject: [PATCH 1/2] resolve publish filters The publish_filters setting wasn't getting resolved so things like `{context.user}` couldn't be used there --- python/tk_multi_loader/model_latestpublish.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/tk_multi_loader/model_latestpublish.py b/python/tk_multi_loader/model_latestpublish.py index 4f55d000..92f15ec9 100644 --- a/python/tk_multi_loader/model_latestpublish.py +++ b/python/tk_multi_loader/model_latestpublish.py @@ -15,6 +15,7 @@ import datetime from . import utils, constants from . import model_item_data +from .utils import resolve_filters # import the shotgun_model module from the shotgun utils framework shotgun_model = sgtk.platform.import_framework("tk-framework-shotgunutils", "shotgun_model") @@ -174,6 +175,8 @@ def load_data(self, item, child_folders, show_sub_items, additional_sg_filters): # to the main entity filters before getting publishes from shotgun. This may be stuff # like 'only status approved' pub_filters = app.get_setting("publish_filters", []) + # resolve the filters so context properties can be used + pub_filters = resolve_filters(pub_filters) sg_filters.extend(pub_filters) # now, on top of that, apply any session specific filters From fc6337dda346a7d1df85bef293df0634fe9c1a52 Mon Sep 17 00:00:00 2001 From: Joe Hultgren Date: Thu, 12 Dec 2019 18:12:11 -0800 Subject: [PATCH 2/2] also need to resolve filters here --- python/tk_multi_loader/model_publishhistory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/tk_multi_loader/model_publishhistory.py b/python/tk_multi_loader/model_publishhistory.py index 80acdb3f..c18672c3 100644 --- a/python/tk_multi_loader/model_publishhistory.py +++ b/python/tk_multi_loader/model_publishhistory.py @@ -76,6 +76,7 @@ def load_data(self, sg_data): # add external filters from config app = sgtk.platform.current_bundle() pub_filters = app.get_setting("publish_filters", []) + pub_filters = utils.resolve_filters(pub_filters) filters.extend(pub_filters) ShotgunModel._load_data(self,