Skip to content

HTTPS clone URL

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
Julien Phalip jphalip authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django_website/blog/views.py
2  django_website/blog/views.py
View
@@ -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.