X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/db44e1e509986909f100e7d1d03f2967d54cbc3d..09f046d960613fb4022cd7f4ad5a66a9787bc32a:/migdal/views.py diff --git a/migdal/views.py b/migdal/views.py index 1ece4cc..84cd6fe 100644 --- a/migdal/views.py +++ b/migdal/views.py @@ -45,8 +45,9 @@ def entry_list(request, type_db=None, category_slug=None): def entry(request, type_db, slug): lang = request.LANGUAGE_CODE - args = {'type': type_db, 'slug_%s' % lang: slug, 'published_%s' % lang: True} - # TODO: preview for admins + args = {'type': type_db, 'slug_%s' % lang: slug} + if not request.user.has_perm('migdal.change_entry'): + args['published_%s' % lang] = True entry = get_object_or_404(Entry, **args) templates = ["migdal/entry/entry_detail.html"]