Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Proper wrapping in blog view decorator

  • Loading branch information...
commit 55f7a33c982b64227c39fc381490370a73a9c388 1 parent e42e8a1
@jphalip jphalip authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django_website/blog/
2  django_website/blog/
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.