+ if not (force_enabled and request.user.is_superuser):
+ if form_class.is_disabled():
+ template = getattr(form_class, 'disabled_template', None)
+ if template:
+ return render(request, template, {'title': form_class.form_title})
+ raise Http404
+ if contact_id:
+ contact = get_object_or_404(Contact, id=contact_id, form_tag=form_tag)
+ if form_tag != 'olimpiada':
+ raise Http404
+ confirmation = form_class.confirmation_class.objects.get(contact=contact)
+ if key != confirmation.key:
+ raise Http404
+ else:
+ contact = None
+ if request.method == 'POST':
+ form = form_class(request.POST, request.FILES, instance=contact)
+ else:
+ form = form_class(initial=request.GET, instance=contact)