Просмотр исходного кода

Pongo login required a pagina principal, ayuda y acerca de

Celestino Rey 9 месяцев назад
Родитель
Сommit
e9da3d0d56
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/gestion_reservas/views.py

+ 4 - 2
src/gestion_reservas/views.py

@@ -3,7 +3,7 @@
 import os
 
 from django.conf import settings
-from django.contrib.auth.decorators import user_passes_test
+from django.contrib.auth.decorators import user_passes_test , login_required
 from django.http import HttpResponseForbidden
 from django.shortcuts import render, get_object_or_404
 from django.utils import timezone
@@ -46,7 +46,7 @@ def ver_variables_entorno(request):
 
     return render(request, 'ver_entorno.html', contexto)
 
-
+@login_required
 def principal(request):
     # Filtra solo las noticias publicadas
     noticias = Noticia.objects.filter(publicado=True)
@@ -57,6 +57,7 @@ def principal(request):
     return render(request, 'index.html', {'noticias': noticias})
 
 
+@login_required
 def ayuda(request):
     elementos_ayuda = Ayuda.objects.all().order_by('apartado')
     apartados = Ayuda.APARTADOS
@@ -68,6 +69,7 @@ def ayuda(request):
     return render(request, 'ayuda.html', {'elementos': elementos_ayuda, 'apartados': apartados})
 
 
+@login_required
 def acerca_de(request):
     context = {
         "app_name": settings.APP_NAME,