File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ def fetch_creativework(pks):
160160 FROM share_agentrelation AS affiliation
161161 JOIN share_agent AS affiliated_agent ON affiliation.related_id = affiliated_agent.id
162162 WHERE affiliation.subject_id = agent.id AND affiliated_agent.type != 'share.person'
163- ) AS affiliations ON TRUE
163+ ) AS affiliations ON (agent.type = 'share.person')
164164 LEFT JOIN LATERAL (
165165 SELECT json_agg(json_strip_nulls(json_build_object(
166166 'id', award.id
Original file line number Diff line number Diff line change @@ -189,7 +189,15 @@ class PIContactAgent(Parser):
189189 schema = 'Person'
190190
191191 name = ctx .PI_NAME
192- related_agents = tools .Map (tools .Delegate (FullIsAffiliatedWith ), ctx ['org_ctx' ])
192+ related_agents = tools .Concat (
193+ tools .Map (tools .Delegate (FullIsAffiliatedWith ), ctx ['org_ctx' ]),
194+ tools .Map (tools .Delegate (DeptIsAffiliatedWith ), RunPython ('if_dept' , ctx ))
195+ )
196+
197+ def if_dept (self , ctx ):
198+ if ctx ['org_ctx' ]['ORG_DEPT' ]:
199+ return {** ctx ['org_ctx' ], 'hash_breaker' : True }
200+ return None
193201
194202 class Extra :
195203 pi_id = RunPython (filter_nil , ctx .PI_ID )
You can’t perform that action at this time.
0 commit comments