Fix API for bulk_upload_checkin_photos
This commit is contained in:
@ -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:
|
||||
# リクエストデータの取得
|
||||
|
||||
Reference in New Issue
Block a user