Use Unauthorized exception for access checks.
--- a/pytask/taskapp/views/task.py Fri Feb 04 16:37:22 2011 +0530
+++ b/pytask/taskapp/views/task.py Fri Feb 04 16:37:56 2011 +0530
@@ -45,6 +45,9 @@
NO_EDIT_RIGHT = ugettext(
"You are not authorized to edit this page.")
+NO_MOD_REVIEWERS_RIGHT = ugettext(
+ "You are not authorized to moderate reviewers.")
+
@login_required
def create_task(request):
@@ -377,7 +380,7 @@
can_mod_reviewers = False
if not can_mod_reviewers:
- raise http.Http404
+ raise exceptions.UnauthorizedAccess(NO_MOD_REVIEWERS_RIGHT)
context = {
'user': user,