Skip to content

Commit 1293de3

Browse files
committed
Merge branch 'hotfix/2.2.13'
2 parents 6f07f09 + 80872d0 commit 1293de3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

bots/elasticsearch/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

providers/gov/nih/normalizer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)