<commit_before>from django.conf import settings
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import render, get_object_or_404

from djforms.admissions.visitdays.models import VisitDay, VisitDayEvent
from djforms.admissions.visitdays.forms import *

from djtools.utils.mail import send_mail
from djtools.utils.convert import str_to_class

email = settings.ADMISSIONS_EMAIL
REQ_ATTR = settings.REQUIRED_ATTRIBUTE


def visit_day_form(request, event_type):
    visit_day = get_object_or_404(VisitDay, slug=event_type)
    short = False
    if request.method=='POST':
        if visit_day.extended:
            form = VisitDayForm(
                event_type, request.POST, use_required_attribute=REQ_ATTR
            )
        else:
            form = VisitDayBaseForm(
                event_type, request.POST, use_required_attribute=REQ_ATTR
            )<commit_msg>allow users to chose an alternate date for the visit<commit_after>from django.conf import settings
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import render, get_object_or_404

from djforms.admissions.visitdays.models import VisitDay, VisitDayEvent
from djforms.admissions.visitdays.forms import *

from djtools.utils.mail import send_mail
from djtools.utils.convert import str_to_class

email = settings.ADMISSIONS_EMAIL
if settings.DEBUG:
    REQ_ATTR = False
else:
    REQ_ATTR = True


def visit_day_form(request, event_type):
    visit_day = get_object_or_404(VisitDay, slug=event_type)
    short = False
    if request.method=='POST':
        if visit_day.extended:
            form = VisitDayForm(
                event_type, request.POST, use_required_attribute=REQ_ATTR
            )
        else:
            form = VisitDayBaseForm(
                event_type, request.POST, use_required_attribute=REQ_ATTR
            )
{'fraction_non_alphanumeric': 0.061277033985581875, 'fraction_numerical': 0.006179196704428424, 'mean_word_length': 3.539719626168224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2961437', 'n_tokens_mistral': 591, 'n_tokens_neox': 559, 'n_words': 134}