changeset 845:41d0389fc85a

For issue #78, check is_public before showing weblinks or downloads.
author Brian Neal <bgneal@gmail.com>
date Sun, 19 Oct 2014 19:36:43 -0500 (2014-10-20)
parents 6900400f971b
children fbfc9b6fac96
files downloads/views.py weblinks/views.py
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/downloads/views.py	Tue Oct 14 15:14:50 2014 -0500
+++ b/downloads/views.py	Sun Oct 19 19:36:43 2014 -0500
@@ -145,6 +145,8 @@
 @login_required
 def details(request, id):
     download = get_object_or_404(Download.public_objects, pk=id)
+    if not download.is_public:
+        raise Http404
     return render_to_response('downloads/download_detail.html', {
         'download' : download,
         },
--- a/weblinks/views.py	Tue Oct 14 15:14:50 2014 -0500
+++ b/weblinks/views.py	Sun Oct 19 19:36:43 2014 -0500
@@ -191,6 +191,8 @@
 
 def link_detail(request, id):
     link = get_object_or_404(Link, pk=id)
+    if not link.is_public:
+        raise Http404
     return render_to_response('weblinks/link_detail.html', {
         'link': link,
         },