X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/99ff7cb43e460029b1769fc21f704b7614381cf1..97a6fccf2124739922f1f5e3e7fc472e2e402a2b:/migdal/views.py diff --git a/migdal/views.py b/migdal/views.py index d8652c7..1f769a9 100644 --- a/migdal/views.py +++ b/migdal/views.py @@ -2,6 +2,7 @@ # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from django.http import Http404 from django.shortcuts import get_object_or_404, render, redirect from django.utils.translation import get_language from fnpdjango.utils.views import set_current_object @@ -60,7 +61,7 @@ def entry(request, type_db=None, slug=None, entry=None): lang = request.LANGUAGE_CODE args = {'type': type_db, 'slug_%s' % lang: slug} entry = get_object_or_404(Entry, **args) - if request.user.has_perm('migdal.change_entry') or not entry.published: + if not entry.published and not request.user.has_perm('migdal.change_entry'): raise Http404 set_current_object(request, entry, in_url=slug is not None)