endpoint de status
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good

This commit is contained in:
juanjo
2026-04-12 22:38:49 +02:00
parent 1bf3337616
commit e5908b1880
3 changed files with 30 additions and 2 deletions

View File

@@ -2,6 +2,10 @@ import logging
from django.http import JsonResponse
from .actions import getData
from django.http import JsonResponse
from .actions import get_status_action
# Configuración del logger para rastrear la ejecución
logger = logging.getLogger(__name__)
@@ -51,4 +55,19 @@ def get_promocion_view(request):
return JsonResponse({
'status': 'error',
'message': 'Error interno del servidor'
}, status=500)
}, status=500)
# En views.py
def status_view(request):
# BLOQUE 1: Log de iniciación
logger.info("Iniciando petición de status...")
# BLOQUE 2: Limpieza y validación de datos (En este caso no hay datos de entrada)
data_cleaned = {}
# BLOQUE 3: Llamada a la acción
response_data = get_status_action()
# BLOQUE 4: Log de cierre y retorno
logger.info("Status enviado correctamente.")
return JsonResponse(response_data, status=200)