X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/18aa8ca52202003e5628a882f3469a04d905cc05..ce097db0af8c96297501b569ec49477b76c1ceec:/src/infopages/views.py diff --git a/src/infopages/views.py b/src/infopages/views.py index a32131024..3d1749f67 100644 --- a/src/infopages/views.py +++ b/src/infopages/views.py @@ -8,7 +8,10 @@ from infopages.models import InfoPage def infopage(request, slug): - page = get_object_or_404(InfoPage, slug=slug) + if request.user.is_staff: + page = get_object_or_404(InfoPage, slug=slug) + else: + page = get_object_or_404(InfoPage, slug=slug, published=True) rc = RequestContext(request) try: