Fix API for bulk_upload_checkin_photos
This commit is contained in:
@ -206,8 +206,8 @@ urlpatterns += [
|
|||||||
path('approve_checkin_history/', approve_checkin_history, name='approve_checkin_history'),
|
path('approve_checkin_history/', approve_checkin_history, name='approve_checkin_history'),
|
||||||
|
|
||||||
## Bulk Photo Upload & Checkin Correction
|
## Bulk Photo Upload & Checkin Correction
|
||||||
path('api/bulk_upload_checkin_photos/', bulk_upload_checkin_photos, name='bulk_upload_checkin_photos'),
|
path('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('get_bulk_upload_status/', get_bulk_upload_status, name='get_bulk_upload_status'),
|
||||||
|
|
||||||
## Waypoint
|
## Waypoint
|
||||||
path('get_waypoint_datas_from_rogapp', get_waypoint_datas_from_rogapp, name='get_waypoint_datas_from_rogapp'),
|
path('get_waypoint_datas_from_rogapp', get_waypoint_datas_from_rogapp, name='get_waypoint_datas_from_rogapp'),
|
||||||
|
|||||||
@ -24,7 +24,7 @@ from ..models import NewEvent2, Entry, GpsLog, Location2025
|
|||||||
# ログ設定
|
# ログ設定
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@api_view(['POST'])
|
@api_view(['POST', 'GET'])
|
||||||
@permission_classes([IsAuthenticated])
|
@permission_classes([IsAuthenticated])
|
||||||
@parser_classes([MultiPartParser, FormParser])
|
@parser_classes([MultiPartParser, FormParser])
|
||||||
def bulk_upload_checkin_photos(request):
|
def bulk_upload_checkin_photos(request):
|
||||||
@ -42,7 +42,21 @@ def bulk_upload_checkin_photos(request):
|
|||||||
request_id = str(uuid.uuid4())[:8]
|
request_id = str(uuid.uuid4())[:8]
|
||||||
client_ip = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', 'Unknown'))
|
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:
|
try:
|
||||||
# リクエストデータの取得
|
# リクエストデータの取得
|
||||||
|
|||||||
Reference in New Issue
Block a user