diff --git a/blog/views.py b/blog/views.py index fe0ad7bfb..8cd30af7a 100644 --- a/blog/views.py +++ b/blog/views.py @@ -20,7 +20,6 @@ def get_queryset(self): return Entry.objects.published() def get_context_data(self, **kwargs): - """ """ context = super().get_context_data(**kwargs) events_queryset = Event.objects.future() @@ -49,4 +48,10 @@ class BlogDayArchiveView(BlogViewMixin, DayArchiveView): class BlogDateDetailView(BlogViewMixin, DateDetailView): - pass + + def get_queryset(self): + """Allows staff users to view unpublished entries""" + if self.request.user.is_staff: + return Entry.objects.all() + else: + return Entry.objects.published()