d8b18cb7b8dc2c0dac707c2f65c6632439ff92d7
[edumed.git] / contact / templatetags / contact_tags.py
1 # -*- coding: utf-8 -*-
2 from django.template import Library
3
4 from contact.forms import contact_forms
5 from contact.models import Contact
6
7 register = Library()
8
9
10 @register.filter
11 def pretty_print(value):
12     return Contact.pretty_print(value)
13
14
15 @register.filter
16 def is_enabled(form_tag):
17     form_class = contact_forms.get(form_tag)
18     if form_class:
19         return not getattr(form_class, 'disabled', False)
20     else:
21         return False