Browse Source

Inscripción automática

politica
Celestino Rey 1 year ago
parent
commit
cae428cc30
3 changed files with 6 additions and 3 deletions
  1. +1
    -1
      JugarAlPadel/K8S/Makefile
  2. +1
    -1
      JugarAlPadel/K8S/Makefile.local
  3. +4
    -1
      JugarAlPadel/gestion_reservas/eventos/views.py

+ 1
- 1
JugarAlPadel/K8S/Makefile View File

@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
#export REGISTRY=localhost:5000 #export REGISTRY=localhost:5000
export REGISTRY=registry.reymota.es export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.21
export IMG_VERSION = 0.22
export IMG_NGINX_VERSION = 2.3 export IMG_NGINX_VERSION = 2.3
# limpia todo # limpia todo


+ 1
- 1
JugarAlPadel/K8S/Makefile.local View File

@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
export REGISTRY=localhost:30500 export REGISTRY=localhost:30500
#export REGISTRY=registry.reymota.es #export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.56
export IMG_VERSION = 0.59
export IMG_NGINX_VERSION = 2.4 export IMG_NGINX_VERSION = 2.4
# limpia todo # limpia todo


+ 4
- 1
JugarAlPadel/gestion_reservas/eventos/views.py View File

@ -5,7 +5,7 @@ from django.core.mail import EmailMultiAlternatives
from django.conf import settings from django.conf import settings
from django.template.loader import render_to_string 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 from .forms import ListaEsperaForm, EventoForm
# import random # import random
@ -48,6 +48,9 @@ def reservar_evento(request, evento_id):
# Aquí hay que mirar si quedan más de n plazas. # Aquí hay que mirar si quedan más de n plazas.
# n es un numero aleatorio entre 2 y el total de plazas # n es un numero aleatorio entre 2 y el total de plazas
# si es así, y ya hay añadir a dos participantes. # 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, messages.success(request,
f'Reserva realizada para el evento {evento.nombre}.') f'Reserva realizada para el evento {evento.nombre}.')


Loading…
Cancel
Save