Skip to content

Commit

Permalink
Show future versions to staff (for admin preview to work).
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Jun 3, 2012
1 parent c35d980 commit d320773
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmsplugin_blog/views.py
Expand Up @@ -8,6 +8,7 @@

from django.http import Http404
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _

from cms.middleware.multilingual import has_lang_prefix
from menus.utils import set_language_changer
Expand Down Expand Up @@ -38,7 +39,7 @@ def get_object(self, queryset=None):
if queryset is None:
queryset = self.get_queryset()

if not self.get_allow_future() and date > datetime.date.today(): # pragma: no cover
if not self.get_allow_future() and date > datetime.date.today() and not self.request.user.is_staff: # pragma: no cover
raise Http404(_(u"Future %(verbose_name_plural)s not available because %(class_name)s.allow_future is False.") % {
'verbose_name_plural': queryset.model._meta.verbose_name_plural,
'class_name': self.__class__.__name__,
Expand Down

0 comments on commit d320773

Please sign in to comment.