diff options
Diffstat (limited to 'tbc')
-rwxr-xr-x | tbc/templates/base.html | 3 | ||||
-rwxr-xr-x | tbc/views.py | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/tbc/templates/base.html b/tbc/templates/base.html index a1b4c8f..40812eb 100755 --- a/tbc/templates/base.html +++ b/tbc/templates/base.html @@ -133,7 +133,6 @@ <li><a href="{% url 'tbc:GetCertificate' %}">Get Certificate</a></li> <li><a href="{% url 'tbc:UpdateProfile' %}">Update Profile</a></li> <li><a href="{% url 'tbc:UpdatePassword' %}">Update Password</a></li> - <li><a href="{% url 'tbc:admin_tools' %}">Admin Tools </a></li> <li><a href="{% url 'tbc:UserLogout' %}">Logout</a></li> </ul> </li> @@ -160,7 +159,9 @@ <ul class="dropdown-menu"> <li><a href="{% url 'tbc:BookReview' %}">Review Books</a></li> <li><a href="{% url 'tbc:ReviewProposals' %}">Review Proposals</a></li> + <li><a href="{% url 'tbc:admin_tools' %}">Admin Tools </a></li> <li><a href="{% url 'tbc:UserLogout' %}">Logout</a></li> + </ul> </li> {% endif %} 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) |