From 741aefca319472617bd99ceea9ff1f2aea8b786e Mon Sep 17 00:00:00 2001 From: ThePetrovich Date: Thu, 26 Jun 2025 18:17:14 +0800 Subject: [PATCH] development dirty hacks --- api/views.py | 2 +- testapi/settings.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/views.py b/api/views.py index 8c46851..7b659c8 100644 --- a/api/views.py +++ b/api/views.py @@ -57,7 +57,7 @@ class PredictionCreateView(APIView): print("Tawhiri error:", str(e), e.response.text if e.response else "no response") return Response({"error": f"Tawhiri error: {str(e)}"}, status=status.HTTP_502_BAD_GATEWAY) - prediction = Prediction.objects.create(result=prediction_result, user=request.user, request=validated_data) + prediction = Prediction.objects.create(result=prediction_result, user=request.user, request=request.data) return Response({ "id": prediction.id, "created_at": prediction.created_at, diff --git a/testapi/settings.py b/testapi/settings.py index d8715c1..8d50619 100644 --- a/testapi/settings.py +++ b/testapi/settings.py @@ -172,8 +172,8 @@ REST_FRAMEWORK = { } -CSRF_COOKIE_SAMESITE = 'Lax' -SESSION_COOKIE_SAMESITE = 'Lax' -CSRF_COOKIE_HTTPONLY = True -SESSION_COOKIE_HTTPONLY = True -CSRF_TRUSTED_ORIGINS = ['http://localhost:5173'] \ No newline at end of file +CSRF_COOKIE_SAMESITE = 'None' # temp +CSRF_COOKIE_SECURE = False +SESSION_COOKIE_SAMESITE = 'None' # temp +SESSION_COOKIE_SECURE = False +CSRF_TRUSTED_ORIGINS = ['http://localhost:5173', 'http://127.0.0.1:5173'] \ No newline at end of file