-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
from django import template
from django.core.cache import cache
n.save()
content = ''
- if context['request'].user.is_staff:
+ if 'request' in context and context['request'].user.is_staff:
content = f'<span data-edit="chunks/chunk/{key}"></span>' + content
return mark_safe(content)