mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 05:30:18 -03:30
Cycle or unset the webhook key if the webhook service changes
Also, tests.
This commit is contained in:
@@ -38,6 +38,7 @@ class WebhookKeyView(GenericAPIView):
|
||||
def post(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
obj.rotate_webhook_key()
|
||||
obj.save(update_fields=['webhook_key'])
|
||||
|
||||
return Response({'webhook_key': obj.webhook_key}, status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user