Commits

Kai Diefenbach  committed f815cdd Merge

Merge

  • Participants
  • Parent commits b5ca831, db2ba42

Comments (0)

Files changed (1)

File lfs/page/views.py

 def page_view(request, slug, template_name="lfs/page/page.html"):
     """Displays page with passed slug
     """
-    if request.user.is_superuser:
-        page = lfs_get_object_or_404(Page, slug=slug)
-    else:
-        page = lfs_get_object_or_404(Page, slug=slug, active=True)
+    page = lfs_get_object_or_404(Page, slug=slug)
+    if request.user.is_superuser or page.active:
+        return render_to_response(template_name, RequestContext(request, {
+            "page" : page
+        }))
 
-    return render_to_response(template_name, RequestContext(request, {
-        "page" : page
-    }))
+    raise Http404('No %s matches the given query.' % page.model._meta.object_name)
 
 def pages_view(request, template_name="lfs/page/pages.html"):
     """Displays an overview of all pages.