Mercurial > public > sg101
comparison downloads/views.py @ 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 |
parents | 89b240fe9297 |
children | a5ebc74dc3f3 |
comparison
equal
deleted
inserted
replaced
844:6900400f971b | 845:41d0389fc85a |
---|---|
143 ####################################################################### | 143 ####################################################################### |
144 | 144 |
145 @login_required | 145 @login_required |
146 def details(request, id): | 146 def details(request, id): |
147 download = get_object_or_404(Download.public_objects, pk=id) | 147 download = get_object_or_404(Download.public_objects, pk=id) |
148 if not download.is_public: | |
149 raise Http404 | |
148 return render_to_response('downloads/download_detail.html', { | 150 return render_to_response('downloads/download_detail.html', { |
149 'download' : download, | 151 'download' : download, |
150 }, | 152 }, |
151 context_instance = RequestContext(request)) | 153 context_instance = RequestContext(request)) |
152 | 154 |