mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 15:06:02 -03:30
Addressing comments, updating tests, etc.
This commit is contained in:
@@ -4473,7 +4473,7 @@ class WorkflowApprovalApprove(RetrieveAPIView):
|
||||
if not request.user.can_access(models.WorkflowApproval, 'approve_or_deny', obj):
|
||||
raise PermissionDenied(detail=_("User does not have permission to approve or deny this workflow."))
|
||||
if obj.status != 'pending':
|
||||
return Response("This workflow step has already been approved or denied.", status=status.HTTP_400_BAD_REQUEST)
|
||||
return Response({"error": _("This workflow step has already been approved or denied.")}, status=status.HTTP_400_BAD_REQUEST)
|
||||
obj.approve(request)
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
@@ -4488,6 +4488,6 @@ class WorkflowApprovalDeny(RetrieveAPIView):
|
||||
if not request.user.can_access(models.WorkflowApproval, 'approve_or_deny', obj):
|
||||
raise PermissionDenied(detail=_("User does not have permission to approve or deny this workflow."))
|
||||
if obj.status != 'pending':
|
||||
return Response("This workflow step has already been approved or denied.", status=status.HTTP_400_BAD_REQUEST)
|
||||
return Response({"error": _("This workflow step has already been approved or denied.")}, status=status.HTTP_400_BAD_REQUEST)
|
||||
obj.deny(request)
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
Reference in New Issue
Block a user