+ return render(
+ request, ['contact/%s/thanks.html' % form_tag, 'contact/thanks.html'],
+ {'base_template': getattr(form_class, 'base_template', None)})
+
+
+def results(request, contact_id, digest):
+ contact = get_object_or_404(Contact, id=contact_id)
+ if digest != contact.digest():
+ raise Http404
+ try:
+ form_class = contact_forms[contact.form_tag]
+ except KeyError:
+ raise Http404
+
+ return render(
+ request, 'contact/%s/results.html' % contact.form_tag,
+ {
+ 'results': form_class.results(contact),
+ 'base_template': getattr(form_class, 'base_template', None),
+ }
+ )