From a5562579e3c17ea9764718dff2335b9ccc28239e Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Sat, 24 Aug 2024 16:21:39 +0200 Subject: [PATCH] Quito la posibilidad de auto registrarse --- Libros/K8S/Makefile | 2 +- Libros/biblioteca/accounts/urls.py | 2 +- Libros/biblioteca/gestion/templates/registration/login.html | 4 ++-- Libros/biblioteca/gestion/views.py | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Libros/K8S/Makefile b/Libros/K8S/Makefile index 05a497e..985aea6 100644 --- a/Libros/K8S/Makefile +++ b/Libros/K8S/Makefile @@ -1,5 +1,5 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') -export IMG_VERSION = 1.34 +export IMG_VERSION = 1.40 export IMG_NGINX_VERSION = 1.17 # limpia todo diff --git a/Libros/biblioteca/accounts/urls.py b/Libros/biblioteca/accounts/urls.py index cb6be4a..6e24af3 100644 --- a/Libros/biblioteca/accounts/urls.py +++ b/Libros/biblioteca/accounts/urls.py @@ -6,7 +6,7 @@ from .views import SignUpView urlpatterns = [ - path("signup/", SignUpView.as_view(), name="signup"), + # path("signup/", SignUpView.as_view(), name="signup"), path('login/', auth_views.LoginView.as_view(), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), ] diff --git a/Libros/biblioteca/gestion/templates/registration/login.html b/Libros/biblioteca/gestion/templates/registration/login.html index 2a94cfe..4f9e4cc 100644 --- a/Libros/biblioteca/gestion/templates/registration/login.html +++ b/Libros/biblioteca/gestion/templates/registration/login.html @@ -61,7 +61,7 @@ -
¿No tienes cuenta? Registrate aquí.
+ - \ No newline at end of file + diff --git a/Libros/biblioteca/gestion/views.py b/Libros/biblioteca/gestion/views.py index 57044cd..a938d36 100644 --- a/Libros/biblioteca/gestion/views.py +++ b/Libros/biblioteca/gestion/views.py @@ -9,16 +9,19 @@ from .models import Autor, Libro from .forms import AutorForm, LibroForm +@login_required def principal(request): return render(request, 'gestion/index.html') # Vistas para los autores +@login_required def lista_autores(request): autores = Autor.objects.all() return render(request, 'gestion/lista_autores.html', {'autores': autores}) +@login_required def detalle_autor(request, autor_id): autor = get_object_or_404(Autor, pk=autor_id) @@ -60,11 +63,13 @@ def eliminar_autor(request, autor_id): # Vistas para los libros +@login_required def lista_libros(request): libros = Libro.objects.all() return render(request, 'gestion/lista_libros.html', {'libros': libros}) +@login_required def detalle_libro(request, libro_id): libro = get_object_or_404(Libro, pk=libro_id) return render(request, 'gestion/detalle_libro.html', {'libro': libro})