Permalink
Browse files

Show future versions to staff (for admin preview to work).

  • Loading branch information...
1 parent c35d980 commit d320773cd6a75989262c4d5c709930bfebfdea8c @mitar committed Jun 3, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 cmsplugin_blog/views.py
View
@@ -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
@@ -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__,

0 comments on commit d320773

Please sign in to comment.