From cae428cc30f1ad8ade26d62def419e70a10805d0 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Sun, 13 Oct 2024 15:11:06 +0000 Subject: [PATCH] =?UTF-8?q?Inscripci=C3=B3n=20autom=C3=A1tica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JugarAlPadel/K8S/Makefile | 2 +- JugarAlPadel/K8S/Makefile.local | 2 +- JugarAlPadel/gestion_reservas/eventos/views.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/JugarAlPadel/K8S/Makefile b/JugarAlPadel/K8S/Makefile index 994eb97..f231616 100644 --- a/JugarAlPadel/K8S/Makefile +++ b/JugarAlPadel/K8S/Makefile @@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') #export REGISTRY=localhost:5000 export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.21 +export IMG_VERSION = 0.22 export IMG_NGINX_VERSION = 2.3 # limpia todo diff --git a/JugarAlPadel/K8S/Makefile.local b/JugarAlPadel/K8S/Makefile.local index f5c710f..46da4d2 100644 --- a/JugarAlPadel/K8S/Makefile.local +++ b/JugarAlPadel/K8S/Makefile.local @@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export REGISTRY=localhost:30500 #export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.56 +export IMG_VERSION = 0.59 export IMG_NGINX_VERSION = 2.4 # limpia todo diff --git a/JugarAlPadel/gestion_reservas/eventos/views.py b/JugarAlPadel/gestion_reservas/eventos/views.py index 46fed45..6807ed6 100644 --- a/JugarAlPadel/gestion_reservas/eventos/views.py +++ b/JugarAlPadel/gestion_reservas/eventos/views.py @@ -5,7 +5,7 @@ from django.core.mail import EmailMultiAlternatives from django.conf import settings from django.template.loader import render_to_string -from .models import Evento, Reserva, ListaEspera +from .models import Evento, Reserva, ListaEspera, ReyMotaUser from .forms import ListaEsperaForm, EventoForm # import random @@ -48,6 +48,9 @@ def reservar_evento(request, evento_id): # Aquí hay que mirar si quedan más de n plazas. # n es un numero aleatorio entre 2 y el total de plazas # si es así, y ya hay añadir a dos participantes. + if evento.reservas.count() > 5: + especial = get_object_or_404(ReyMotaUser, email="motagarrido@yahoo.es") + Reserva.objects.create(evento=evento, usuario=especial) messages.success(request, f'Reserva realizada para el evento {evento.nombre}.')