Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
author submissions: add author accept curate action
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Aug 12, 2024
2 parents 1f6cf0b + 6ed6b97 commit 773da6b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backoffice/backoffice/workflows/airflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def trigger_airflow_dag(dag_id, workflow_id, extra_data=None):
data = {"dag_run_id": str(workflow_id), "conf": {"workflow_id": str(workflow_id)}}

if extra_data is not None:
data["conf"].update(extra_data)
data["conf"]["data"] = extra_data

url = f"{AIRFLOW_BASE_URL}/api/v1/dags/{dag_id}/dagRuns"

Expand Down
4 changes: 2 additions & 2 deletions backoffice/backoffice/workflows/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def __init__(self, *args, **kwargs):

faceted_search_fields = {
"status": {
"field": "status.keyword",
"field": "status",
"facet": TermsFacet,
"options": {
"size": 10,
Expand All @@ -284,7 +284,7 @@ def __init__(self, *args, **kwargs):
"enabled": True,
},
"workflow_type": {
"field": "workflow_type.keyword",
"field": "workflow_type",
"facet": TermsFacet,
"options": {
"size": 10,
Expand Down
7 changes: 5 additions & 2 deletions workflows/dags/author/author_create/author_create_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging

from airflow.decorators import dag, task
from airflow.models import Variable
from airflow.models.param import Param
from hooks.backoffice.workflow_management_hook import AUTHORS, WorkflowManagementHook
from hooks.backoffice.workflow_ticket_management_hook import (
Expand Down Expand Up @@ -50,10 +51,12 @@ def set_workflow_status_to_running(**context):

@task()
def set_schema(**context):
schema = "https://inspirehep.net/schemas/records/authors.json"
schema = Variable.get("author_schema")
workflow_management_hook.partial_update_workflow(
workflow_id=context["params"]["workflow_id"],
workflow_partial_update_data={"data": {"$schema": schema}},
workflow_partial_update_data={
"data": {**context["params"]["data"], "$schema": schema}
},
collection=AUTHORS,
)

Expand Down
3 changes: 2 additions & 1 deletion workflows/scripts/variables/variables.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"backoffice_token": "2e04111a61e8f5ba6ecec52af21bbb9e81732085",
"inspire_token": "CHANGE_ME"
"inspire_token": "CHANGE_ME",
"author_schema": "https://inspirehep.net/schemas/records/authors.json"
}

0 comments on commit 773da6b

Please sign in to comment.