fix restore checkin list

This commit is contained in:
2025-09-04 11:27:04 +09:00
parent 3cb0c2daf7
commit 32f860af41
2 changed files with 28 additions and 7 deletions

View File

@ -87,15 +87,14 @@ local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD # TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only # "local" is for Unix domain socket connections only
# md5認証に変更してpeer認証エラーを回避 local all all peer
local all all md5
# IPv4 local connections: # IPv4 local connections:
host all all 127.0.0.1/32 md5 host all all 127.0.0.1/32 md5
# IPv6 local connections: # IPv6 local connections:
host all all ::1/128 md5 host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the # Allow replication connections from localhost, by a user with the
# replication privilege. # replication privilege.
local replication all md5 local replication all peer
host replication all 127.0.0.1/32 md5 host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5 host replication all ::1/128 md5
host all all 172.0.0.0/8 md5 host all all 172.0.0.0/8 md5

View File

@ -9,6 +9,7 @@ from rog.models import Location2025, NewEvent2, Entry, GpsLog
import logging import logging
import uuid import uuid
import os import os
import json
from django.db.models import F, Q from django.db.models import F, Q
from django.db import transaction from django.db import transaction
from django.conf import settings from django.conf import settings
@ -1087,11 +1088,32 @@ def get_checkin_list(request):
""" """
logger.info("get_checkin_list called") logger.info("get_checkin_list called")
# リクエストからパラメータを取得 # リクエストからパラメータを取得GET/POSTの両方に対応
zekken_number = request.query_params.get('zekken') if request.method == 'GET':
event_code = request.query_params.get('event') 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]): if not all([zekken_number, event_code]):