- else:
- form = ContactForm() # An unbound form
-
- return render(request, 'contact.html', {
- 'form': form,
- 'topmenu_items': topmenu_items('Contact Us', request),
- 'username': the_user (request)
-
- })
-
+ else:
+ return self._display (request, form)
+
+ def get (self, request):
+ return self._display (request, ContactForm()) # A fresh unbound form
+
+ def _display (self, request, form):
+ return render(request, 'contact.html', {
+ 'form': form,
+ 'topmenu_items': topmenu_items('Contact Us', request),
+ 'username': the_user (request)
+ })