Fix webhook logs endpoint CSRF and error handling

- Add @csrf_exempt decorator to get_webhook_logs view
- Add try-catch error handling for webhook logs retrieval
- This should resolve the 'Unexpected token' JSON parsing errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude 2025-07-12 15:41:03 +05:30
parent b865fd4781
commit 16d07168d0

View File

@ -260,9 +260,14 @@ def simple_webhook_test(request):
return HttpResponse("WEBHOOK RECEIVED OK", content_type="text/plain")
@csrf_exempt
def get_webhook_logs(request):
"""Get webhook logs for the test page"""
try:
return JsonResponse({'logs': webhook_logs})
except Exception as e:
print(f"Error in get_webhook_logs: {e}")
return JsonResponse({'logs': [], 'error': str(e)})
@csrf_exempt