Commits

Benjamin Guidarelli committed baf0dc3

added login pages

  • Participants
  • Parent commits 32eda85

Comments (0)

Files changed (1)

 from django.shortcuts import get_object_or_404, render_to_response
 from django.template import RequestContext
 from django.views.decorators.csrf import csrf_protect
+from django.contrib.auth.decorators import login_required
+
 
 from forms import MovePageForm
 from models import Page
 
 @csrf_protect
 def render_page(request, p):
+    if p.template[-12:] == "Members Only":
+        return render_members_only(request, p)
     return render_to_response(get_path(p.template), {
         'page': p,
     }, context_instance=RequestContext(request))
 
+@login_required
+def render_members_only(request, p):
+    return render_to_response(get_path(p.template), {
+        'page':p,        
+    }, context_instance=RequestContext(request))
+
+
 
 def move_page(request):
     if not request.POST: