Fix API for bulk_upload_checkin_photos

This commit is contained in:
2025-09-06 00:45:51 +09:00
parent fdc1d66f08
commit efa51b4fcc
2 changed files with 18 additions and 4 deletions

View File

@ -206,8 +206,8 @@ urlpatterns += [
path('approve_checkin_history/', approve_checkin_history, name='approve_checkin_history'),
## Bulk Photo Upload & Checkin Correction
path('api/bulk_upload_checkin_photos/', bulk_upload_checkin_photos, name='bulk_upload_checkin_photos'),
path('api/get_bulk_upload_status/', get_bulk_upload_status, name='get_bulk_upload_status'),
path('bulk_upload_checkin_photos/', bulk_upload_checkin_photos, name='bulk_upload_checkin_photos'),
path('get_bulk_upload_status/', get_bulk_upload_status, name='get_bulk_upload_status'),
## Waypoint
path('get_waypoint_datas_from_rogapp', get_waypoint_datas_from_rogapp, name='get_waypoint_datas_from_rogapp'),

View File

@ -24,7 +24,7 @@ from ..models import NewEvent2, Entry, GpsLog, Location2025
# ログ設定
logger = logging.getLogger(__name__)
@api_view(['POST'])
@api_view(['POST', 'GET'])
@permission_classes([IsAuthenticated])
@parser_classes([MultiPartParser, FormParser])
def bulk_upload_checkin_photos(request):
@ -42,7 +42,21 @@ def bulk_upload_checkin_photos(request):
request_id = str(uuid.uuid4())[:8]
client_ip = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', 'Unknown'))
logger.info(f"[BULK_UPLOAD] 🎯 API call started - ID: {request_id}, User: {request.user.email if request.user.is_authenticated else 'Anonymous'}, Client IP: {client_ip}")
logger.info(f"[BULK_UPLOAD] 🎯 API ACCESS CONFIRMED - bulk_upload_checkin_photos called successfully - ID: {request_id}, Method: {request.method}, User: {request.user.email if request.user.is_authenticated else 'Anonymous'}, Client IP: {client_ip}")
logger.info(f"[BULK_UPLOAD] 🔍 Request details - Content-Type: {request.content_type}, POST data keys: {list(request.POST.keys())}, FILES count: {len(request.FILES)}")
# GETリクエストの場合は、APIが動作していることを確認するための情報を返す
if request.method == 'GET':
logger.info(f"[BULK_UPLOAD] 📋 GET request received - returning API status")
return Response({
"status": "ACTIVE",
"message": "一括写真アップロードAPIが動作中です",
"endpoint": "/api/bulk_upload_checkin_photos/",
"method": "POST",
"required_params": ["event_code", "zekken_number", "photos"],
"optional_params": ["auto_process"],
"user": request.user.email if request.user.is_authenticated else 'Not authenticated'
}, status=status.HTTP_200_OK)
try:
# リクエストデータの取得