from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from fnpdjango.utils.views import serve_file
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from fnpdjango.utils.views import serve_file
def form(request, form_tag, force_enabled=False):
try:
form_class = contact_forms[form_tag]
def form(request, form_tag, force_enabled=False):
try:
form_class = contact_forms[form_tag]
not (force_enabled and request.user.is_superuser)):
template = getattr(form_class, 'disabled_template', None)
if template:
not (force_enabled and request.user.is_superuser)):
template = getattr(form_class, 'disabled_template', None)
if template:
raise Http404
if request.method == 'POST':
form = form_class(request.POST, request.FILES)
raise Http404
if request.method == 'POST':
form = form_class(request.POST, request.FILES)