Skip to content

Commit

Permalink
workflows: add core requirement to uk and ger queue
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalEgn committed Dec 20, 2024
1 parent b3c29cc commit 04956d7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
4 changes: 2 additions & 2 deletions inspirehep/modules/workflows/tasks/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
56 changes: 32 additions & 24 deletions inspirehep/modules/workflows/workflows/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -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(
Expand All @@ -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',
),
)
]
)
),
Expand Down

0 comments on commit 04956d7

Please sign in to comment.