959e0f81b5e93fc89eae456c48d1d68a2a9cc7af
[cas.git] / src / services / templatetags / services.py
1 from django.template import Library
2 from ..models import Service
3
4
5 register = Library()
6
7
8 @register.simple_tag(takes_context=True)
9 def use_ssh(context):
10     user = context['request'].user
11     if user.is_anonymous: return True
12     return Service.for_user(user).filter(uses_ssh=True).exists()