<commit_before>from django.shortcuts import render
from applications.forms import ApplicationForm
from datetime import datetime
from django.views.generic.edit import FormView


APPLICATION_START_DATE = datetime(2018, 8, 13)
APPLICATION_END_DATE = datetime(2018, 9, 2, 1, 0, 0)


class ApplicationView(FormView):
    template_name = 'applications/application_form.html'
    form_class = ApplicationForm
    success_url = '/opptak/success'

    def form_valid(self, form):
        form.send_email()
        form.save()
        return super(ApplicationView, self).form_valid(form)

    def dispatch(self, request, *args, **kwargs):
        current_date = datetime.now()
        if current_date < APPLICATION_START_DATE:
            return render(request, 'applications/application_too_early.html')
        elif current_date > APPLICATION_END_DATE:
            return render(request, 'applications/application_too_late.html')
        else:
            return super(ApplicationView, self).dispatch(request, *args, **kwargs)<commit_msg>Fix so that application is due to 24:00 the 2.<commit_after>from django.shortcuts import render
from applications.forms import ApplicationForm
from datetime import datetime
from django.views.generic.edit import FormView


APPLICATION_START_DATE = datetime(2018, 8, 13)
APPLICATION_END_DATE = datetime(2018, 9, 3)


class ApplicationView(FormView):
    template_name = 'applications/application_form.html'
    form_class = ApplicationForm
    success_url = '/opptak/success'

    def form_valid(self, form):
        form.send_email()
        form.save()
        return super(ApplicationView, self).form_valid(form)

    def dispatch(self, request, *args, **kwargs):
        current_date = datetime.now()
        if current_date < APPLICATION_START_DATE:
            return render(request, 'applications/application_too_early.html')
        elif current_date > APPLICATION_END_DATE:
            return render(request, 'applications/application_too_late.html')
        else:
            return super(ApplicationView, self).dispatch(request, *args, **kwargs)
{'fraction_non_alphanumeric': 0.08973128598848369, 'fraction_numerical': 0.016314779270633396, 'mean_word_length': 3.8488372093023258, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1265966', 'n_tokens_mistral': 617, 'n_tokens_neox': 566, 'n_words': 141}