1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django import template
6 from ssify import ssi_variable
7 from ssify.utils import ssi_vary_on_cookie
9 register = template.Library()
12 @ssi_variable(register, patch_response=[ssi_vary_on_cookie])
13 def user_username(request):
14 return request.user.username
17 @ssi_variable(register, patch_response=[ssi_vary_on_cookie])
18 def user_is_staff(request):
19 return request.user.is_staff