diff --git a/custom-pg_hba.conf b/custom-pg_hba.conf index 3fe8084..07b9648 100644 --- a/custom-pg_hba.conf +++ b/custom-pg_hba.conf @@ -87,15 +87,14 @@ local all postgres peer # TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only -# md5認証に変更してpeer認証エラーを回避 -local all all md5 +local all all peer # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 # Allow replication connections from localhost, by a user with the # replication privilege. -local replication all md5 +local replication all peer host replication all 127.0.0.1/32 md5 host replication all ::1/128 md5 host all all 172.0.0.0/8 md5 diff --git a/rog/views_apis/api_edit.py b/rog/views_apis/api_edit.py index a74298a..fe0a939 100755 --- a/rog/views_apis/api_edit.py +++ b/rog/views_apis/api_edit.py @@ -9,6 +9,7 @@ from rog.models import Location2025, NewEvent2, Entry, GpsLog import logging import uuid import os +import json from django.db.models import F, Q from django.db import transaction from django.conf import settings @@ -1087,11 +1088,32 @@ def get_checkin_list(request): """ logger.info("get_checkin_list called") - # リクエストからパラメータを取得 - zekken_number = request.query_params.get('zekken') - event_code = request.query_params.get('event') + # リクエストからパラメータを取得(GET/POSTの両方に対応) + if request.method == 'GET': + zekken_number = request.GET.get('zekken') + event_code = request.GET.get('event') + else: # POST + try: + data = json.loads(request.body) + zekken_number = data.get('zekken') + event_code = data.get('event') + except: + data = request.POST + zekken_number = data.get('zekken') + event_code = data.get('event') - logger.debug(f"Parameters: zekken={zekken_number}, event={event_code}") + logger.info(f"[GET_CHECKIN_LIST] Request method: {request.method}") + logger.info(f"[GET_CHECKIN_LIST] Parameters received - zekken: {zekken_number}, event: {event_code}") + logger.info(f"[GET_CHECKIN_LIST] Full GET params: {dict(request.GET.items())}") + logger.info(f"[GET_CHECKIN_LIST] Full POST params: {dict(request.POST.items()) if request.method == 'POST' else 'N/A'}") + + # POSTの場合のリクエストボディも確認 + if request.method == 'POST': + try: + body_content = request.body.decode('utf-8') + logger.info(f"[GET_CHECKIN_LIST] Request body: {body_content}") + except: + logger.info(f"[GET_CHECKIN_LIST] Could not decode request body") # パラメータ検証 if not all([zekken_number, event_code]):