"zgłoś się na warsztaty" in results
[edumed.git] / contact / templatetags / contact_tags.py
index e84064a..d8b18cb 100755 (executable)
@@ -1,8 +1,21 @@
+# -*- coding: utf-8 -*-
 from django.template import Library
+
+from contact.forms import contact_forms
 from contact.models import Contact
 
 register = Library()
 
+
 @register.filter
 def pretty_print(value):
     return Contact.pretty_print(value)
+
+
+@register.filter
+def is_enabled(form_tag):
+    form_class = contact_forms.get(form_tag)
+    if form_class:
+        return not getattr(form_class, 'disabled', False)
+    else:
+        return False