diff options
author | ankitjavalkar | 2016-04-21 15:17:07 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-04-21 15:17:07 +0530 |
commit | 227a5d9ea190d895e788108bda77316b6b6b867a (patch) | |
tree | a6bd0fcc7e06df44046e08e6c7c29f8860e462a3 /tbc/views.py | |
parent | 5d4ee0860bc6c92f845624bca2a8d515c96c4a30 (diff) | |
parent | eb79ae5bb0d6525d812b03b21b2085a796c4567a (diff) | |
download | Python-TBC-Interface-227a5d9ea190d895e788108bda77316b6b6b867a.tar.gz Python-TBC-Interface-227a5d9ea190d895e788108bda77316b6b6b867a.tar.bz2 Python-TBC-Interface-227a5d9ea190d895e788108bda77316b6b6b867a.zip |
Merge pull request #28 from maheshgudi/master
added admin tools link
Diffstat (limited to 'tbc/views.py')
-rwxr-xr-x | tbc/views.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tbc/views.py b/tbc/views.py index 767dd4e..18e2d4d 100755 --- a/tbc/views.py +++ b/tbc/views.py @@ -1,6 +1,6 @@ from django.utils.encoding import force_text from django.contrib.contenttypes.models import ContentType -from django.http import HttpResponse, HttpResponseRedirect +from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render_to_response, redirect from django.views.decorators.csrf import csrf_exempt from django.core.context_processors import csrf @@ -1189,6 +1189,7 @@ def BrowseBooks(request): return render_to_response('tbc/browse-books.html', context) + def ConvertNotebook(request, notebook_path=None): """ Checks for the modified time of ipython notebooks and corresponding html page and replaces html page with new one if corresponding ipython notebook has been modified. """ @@ -1417,8 +1418,10 @@ def link_image(request): @login_required( login_url= "/admin") def admin_tools(request): ci = RequestContext(request) - user = request.user - context = {"user":user} - return render_to_response('tbc/admin-tools.html', context, context_instance=ci) - - + curr_user = request.user + + if not is_reviewer(curr_user): + raise Http404("You are not allowed to view this page") + else: + context = {"user":curr_user} + return render_to_response('tbc/admin-tools.html', context, context_instance=ci) |