diff -r 4a38ed4b891b -r 6dc78471e60d apps/blog/views.py
--- a/apps/blog/views.py Mon Nov 30 21:50:58 2009 -0800
+++ b/apps/blog/views.py Mon Nov 30 22:07:24 2009 -0800
@@ -107,10 +107,13 @@
def post_detail(request, year, month, day, slug):
reply_to = _get_reply_to(request)
year, month, day = int(year), int(month), int(day)
- post = get_object_or_404(Post.all_objects, slug=slug,
- date__year=year,
- date__month=month,
- date__day=day)
+ filtr = {'slug': slug,
+ 'date__year': year,
+ 'date__month': month,
+ 'date__day': day}
+ if not request.user.is_staff:
+ filtr['is_draft'] = False
+ post = get_object_or_404(Post.all_objects, **filtr)
if post.comments_open():
Form = (request.user.is_authenticated()
and CommentForm
Applied, thanks.
--
Alexander