diff --git a/inspirehep/modules/workflows/tasks/actions.py b/inspirehep/modules/workflows/tasks/actions.py index 0145d1abfe..c1ced3e016 100644 --- a/inspirehep/modules/workflows/tasks/actions.py +++ b/inspirehep/modules/workflows/tasks/actions.py @@ -1151,9 +1151,9 @@ def check_if_germany_in_raw_affiliations(obj, eng): return True -def check_if_core_and_uk_in_fulltext(obj, eng): +def check_if_uk_in_fulltext(obj, eng): fulltext = get_fulltext(obj) - if not fulltext or not is_core(obj, eng): + if not fulltext: return regex = re.compile( r"\b(UK|United\s+Kingdom|England|Scotland|Northern\s+Ireland)\b", re.UNICODE | re.IGNORECASE) diff --git a/inspirehep/modules/workflows/workflows/article.py b/inspirehep/modules/workflows/workflows/article.py index 0f148eefb8..44467920ca 100644 --- a/inspirehep/modules/workflows/workflows/article.py +++ b/inspirehep/modules/workflows/workflows/article.py @@ -79,7 +79,7 @@ check_if_germany_in_fulltext, check_if_germany_in_raw_affiliations, link_institutions_with_affiliations, - check_if_core_and_uk_in_fulltext, + check_if_uk_in_fulltext, check_if_uk_in_raw_affiliations, ) @@ -291,14 +291,17 @@ ), ), IF( - check_if_core_and_uk_in_fulltext, - create_ticket( - template='literaturesuggest/tickets/curation_core.html', - queue='UK_curation', - context_factory=curation_ticket_context, - ticket_id_key='curation_ticket_id', + is_core, + IF( + check_if_uk_in_fulltext, + create_ticket( + template='literaturesuggest/tickets/curation_core.html', + queue='UK_curation', + context_factory=curation_ticket_context, + ticket_id_key='curation_ticket_id', + ), ), - ) + ), ], [ IF( @@ -311,23 +314,28 @@ ), ), IF( - check_if_germany_in_raw_affiliations, - create_ticket( - template='literaturesuggest/tickets/curation_core.html', - queue='GER_curation', - context_factory=curation_ticket_context, - ticket_id_key='curation_ticket_id', - ), + is_core, + [ + IF( + check_if_germany_in_raw_affiliations, + create_ticket( + template='literaturesuggest/tickets/curation_core.html', + queue='GER_curation', + context_factory=curation_ticket_context, + ticket_id_key='curation_ticket_id', + ), + ), + IF( + check_if_uk_in_raw_affiliations, + create_ticket( + template='literaturesuggest/tickets/curation_core.html', + queue='UK_curation', + context_factory=curation_ticket_context, + ticket_id_key='curation_ticket_id', + ), + ), + ], ), - IF( - check_if_uk_in_raw_affiliations, - create_ticket( - template='literaturesuggest/tickets/curation_core.html', - queue='UK_curation', - context_factory=curation_ticket_context, - ticket_id_key='curation_ticket_id', - ), - ) ] ) ),