diff options
author | Dusty Phillips <buchuki@gmail.com> | 2008-06-27 16:50:01 -0400 |
---|---|---|
committer | Dusty Phillips <buchuki@gmail.com> | 2008-06-27 16:50:01 -0400 |
commit | c1d28bce3353b3d76d59e22761cf21b710dd1bc4 (patch) | |
tree | 273e01e98032366497e0196e0baf43d84914210d /todolists/views.py | |
parent | 454d7cf255c5b9732d8d43221cb488af764fbcbd (diff) |
use a nicer decorator
Diffstat (limited to 'todolists/views.py')
-rw-r--r-- | todolists/views.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/todolists/views.py b/todolists/views.py index 3a96dc87..2a7d1f09 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -1,6 +1,6 @@ from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404 -from django.contrib.auth.decorators import user_passes_test +from django.contrib.auth.decorators import permission_required from django.contrib.auth.models import User from archweb_dev.main.utils import render_response from archweb_dev.main.models import Todolist, TodolistPkg, Package @@ -32,7 +32,7 @@ def list(request): list=l.id,complete=False).count() == 0 return render_response(request, 'todolists/list.html', {'lists':lists}) -@user_passes_test(lambda u: u.has_perm('todolists.add_todolist')) +@permission_required('todolists.add_todolist') def add(request): if request.POST: try: |