Commits

exe....@gmail.com  committed 69a3eb1

fix views

  • Participants
  • Parent commits 17b75e8

Comments (0)

Files changed (1)

 def main(request):
     """listado de Peñas"""
     penas = Pena.objects.all().order_by("-created")
-    paginator = Paginator(posts, 2)
+    paginator = Paginator(penas, 2)
     try: page = int(request.GET.get("page", '1'))
     except ValueError: page = 1
 
     except (InvalidPage, EmptyPage):
         penas = paginator.page(paginator.num_pages)
 
-    return render_to_response("list.html", dict(posts=posts, user=request.user,
+    return render_to_response("list.html", dict(penas=penas, user=request.user,
                                                 pena_list=penas.object_list, ))
 
 def pena(request, slug):
     """Peña con comentarios"""
     pena = Pena.objects.get(slug=slug)
     comments = PenaComment.objects.filter(pena=pena)
-    d = dict(post=post, comments=comments, form=PenaCommentform(), user=request.user)
+    d = dict(pena=pena, comment_pena=comment_pena, form=PenaCommentform(), user=request.user)
     d.update(csrf(request))
     return render_to_response("pena.html", d)
 
 
 @login_required
 @csrf_protect
-def comment_pena(request, slug=None):
+def comment_pena(request, slug):
     """Comentar peña"""
     if request.method == 'POST':
         pena_comment_form = PenaCommentform(request.POST)