Permalink
Browse files

Proper wrapping in blog view decorator

  • Loading branch information...
1 parent e42e8a1 commit 55f7a33c982b64227c39fc381490370a73a9c388 @jphalip jphalip committed May 16, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 django_website/blog/views.py
View
2 django_website/blog/views.py
@@ -1,8 +1,10 @@
+import functools
from django.views.generic import date_based
from .models import Entry
def prepare_arguments(view):
+ @functools.wraps(view)
def wrapped(request, *args, **kwargs):
kwargs['allow_future'] = request.user.is_staff
kwargs['queryset'] = Entry.objects.all() if request.user.is_staff else Entry.objects.published()

0 comments on commit 55f7a33

Please sign in to comment.