mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 13:41:28 -03:30
Include a message in the webhook response
This commit is contained in:
parent
7aa424b210
commit
dd6c97ed87
@ -112,7 +112,8 @@ class WebhookReceiverBase(APIView):
|
||||
if WorkflowJob.objects.filter(**kwargs).exists() or Job.objects.filter(**kwargs).exists():
|
||||
# Short circuit if this webhook has already been received and acted upon.
|
||||
logger.debug("Webhook previously received, returning without action.")
|
||||
return Response(status=status.HTTP_202_ACCEPTED)
|
||||
return Response({'message': "Webhook previously received, aborting."},
|
||||
status=status.HTTP_202_ACCEPTED)
|
||||
|
||||
new_job = obj.create_unified_job(
|
||||
_eager_fields={
|
||||
@ -128,7 +129,7 @@ class WebhookReceiverBase(APIView):
|
||||
)
|
||||
new_job.signal_start()
|
||||
|
||||
return Response(status=status.HTTP_202_ACCEPTED)
|
||||
return Response({'message': "Job queued."}, status=status.HTTP_202_ACCEPTED)
|
||||
|
||||
|
||||
class GithubWebhookReceiver(WebhookReceiverBase):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user