Skip to content

Commit

Permalink
fix : no permitir crear paquetes con fecha inicio y fecha fin iguales #…
Browse files Browse the repository at this point in the history
  • Loading branch information
juancruz1990 committed Sep 17, 2023
1 parent 164afeb commit 340260c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hotel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ def paqueteTuristicoHotelCrear(request, hotel):
if request.method == "POST":
fecha_inicio = request.POST['inicio']
fecha_fin = request.POST['fin']
if (fecha_inicio == fecha_fin):
form.add_error('inicio', 'la fecha inicio no puede ser igual a la fecha de finalizacion')
form.add_error('fin', 'la fecha finalizacion no puede ser igual a la fecha de inicio')
return render(request, "hotel/modals/modal_paqueteTuristicoHotel_crear.html", { "hotel": hotel_actual, "formulario": form})
id_habitaciones = request.POST.getlist('habitaciones')
for id_habitacion in id_habitaciones:
habitacion = Habitacion.objects.get(id=id_habitacion)
Expand Down

0 comments on commit 340260c

Please sign in to comment.