Commits

ubernostrum  committed 52f58aa

Minor tweak for callback support

  • Participants
  • Parent commits 1078b7d

Comments (0)

Files changed (1)

         """
         if not self.is_valid():
             raise ValueError("Message cannot be rendered from invalid contact form")
-        t = loader.get_template(self.template_name)
+        if callable(self.template_name):
+            template_name = self.template_name()
+        else:
+            template_name = self.template_name
+        t = loader.get_template(template_name)
         return t.render(RequestContext(self.request, self.cleaned_data))