From 40efd93cc1e904fb9f0546f890e7b1cb0fdb9411 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Sun, 18 May 2025 16:07:15 +0200 Subject: [PATCH] Estadisticas para todos. Solo admin borra --- JugarAlPadel/K8S/Makefile | 2 +- JugarAlPadel/K8S/env-prod-configmap.yaml | 2 +- JugarAlPadel/gestion_reservas/eventos/views.py | 2 -- JugarAlPadel/gestion_reservas/templates/base.html | 4 ++-- .../templates/eventos/eventos_por_usuario.html | 5 +++++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/JugarAlPadel/K8S/Makefile b/JugarAlPadel/K8S/Makefile index 17b0fa3..f90d3cc 100644 --- a/JugarAlPadel/K8S/Makefile +++ b/JugarAlPadel/K8S/Makefile @@ -1,7 +1,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.70.35 +export IMG_VERSION = 0.70.37 export IMG_NGINX_VERSION = 2.3 # limpia todo diff --git a/JugarAlPadel/K8S/env-prod-configmap.yaml b/JugarAlPadel/K8S/env-prod-configmap.yaml index ab0a36b..67e2f1d 100644 --- a/JugarAlPadel/K8S/env-prod-configmap.yaml +++ b/JugarAlPadel/K8S/env-prod-configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 data: DEBUG: "False" - APP_VERSION: 14.0.0 + APP_VERSION: 14.0.1 DATABASE: postgres kind: ConfigMap metadata: diff --git a/JugarAlPadel/gestion_reservas/eventos/views.py b/JugarAlPadel/gestion_reservas/eventos/views.py index be439d0..39507bc 100644 --- a/JugarAlPadel/gestion_reservas/eventos/views.py +++ b/JugarAlPadel/gestion_reservas/eventos/views.py @@ -365,13 +365,11 @@ def enviar_correo_inscritos(request, evento_id): return render(request, 'eventos/enviar_correo_inscritos.html', {'form': form, 'evento': evento}) -@user_passes_test(es_admin) def estadisticas_por_usuario(request): usuarios = User.objects.annotate(num_eventos=Count("reserva__evento")).order_by("-num_eventos") return render(request, "eventos/estadisticas_usuarios.html", {"usuarios": usuarios}) -@user_passes_test(lambda u: u.is_staff) def eventos_por_usuario(request, usuario_id): usuario = get_object_or_404(User, pk=usuario_id) reservas = Reserva.objects.filter(usuario=usuario).select_related("evento") diff --git a/JugarAlPadel/gestion_reservas/templates/base.html b/JugarAlPadel/gestion_reservas/templates/base.html index bca0323..7cc3ac3 100644 --- a/JugarAlPadel/gestion_reservas/templates/base.html +++ b/JugarAlPadel/gestion_reservas/templates/base.html @@ -122,6 +122,8 @@ Crear un nuevo evento + + {% endif %} @@ -133,8 +135,6 @@ Estadísticas por usuario - - {% endif %}