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
1 parent 720429e commit 75566bb
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions backoffice/backoffice/workflows/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class AuthorWorkflowViewSet(viewsets.ViewSet):
serializer_class = WorkflowAuthorSerializer

@extend_schema(
summary="Create/Update an Author",
description="Creates/Updates an author, launches the required airflow dags.",
summary="Create a New Author",
description="Creates a new author, launches the required airflow dags.",
request=serializer_class,
)
def create(self, request):
Expand All @@ -127,31 +127,6 @@ def create(self, request):
workflow.data,
)

@extend_schema(
summary="Updates an Author",
description="Updates an author, launches the required airflow dag.",
request=serializer_class,
)
def update(self, request, pk=None):
logger.info("Creating workflow with data: %s", request.data)
serializer = self.serializer_class(data=request.data)
if serializer.is_valid(raise_exception=True):
workflow = Workflow.objects.create(
data=serializer.validated_data["data"],
workflow_type=WorkflowType.AUTHOR_UPDATE,
)

logger.info(
"Trigger Airflow DAG: %s for %s",
WORKFLOW_DAGS[workflow.workflow_type].initialize,
workflow.id,
)
return airflow_utils.trigger_airflow_dag(
WORKFLOW_DAGS[workflow.workflow_type].initialize,
str(workflow.id),
workflow.data,
)

@extend_schema(
summary="Partially Updates Author",
description="Updates specific fields of the author.",
Expand Down

0 comments on commit 75566bb

Please sign in to comment.