endpoint de status
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user