<commit_before>from django.views.generic.edit import FormView
from django.core.exceptions import PermissionDenied
from C4CApplication.views.utils import create_user
from C4CApplication.views.forms.DonateTimeForm import DonateTimeForm


class DonateTimeView(FormView):
    template_name = "C4CApplication/DonateTime.html"
    form_class = DonateTimeForm
    success_url = "processing/"

    def dispatch(self, request, *args, **kwargs):
        if 'email' not in self.request.session:
            raise PermissionDenied  # HTTP 403
        self.user = create_user(self.request.session['email'])
        return super(FavoritesView, self).dispatch(request, *args, **kwargs)
    
    def get_context_data(self, **kwargs):
        if 'email' not in self.request.session:
            raise PermissionDenied  # HTTP 403
        context = super(DonateTimeView, self).get_context_data(**kwargs)
        context['donateTime'] = DonateTimeForm(auto_id=False)
        context['member'] = self.user.db_member
        context['connected'] = 'email' in self.request.session
        return context<commit_msg>bull bizar !<commit_after>from django.views.generic.edit import FormView
from django.core.exceptions import PermissionDenied
from C4CApplication.views.utils import create_user
from C4CApplication.views.forms.DonateTimeForm import DonateTimeForm


class DonateTimeView(FormView):
    template_name = "C4CApplication/DonateTime.html"
    form_class = DonateTimeForm
    success_url = "processing/"

    def dispatch(self, request, *args, **kwargs):
        if 'email' not in self.request.session:
            raise PermissionDenied  # HTTP 403
        self.user = create_user(self.request.session['email'])
        return super(DonateTimeView, self).dispatch(request, *args, **kwargs)
    
    def get_context_data(self, **kwargs):
        if 'email' not in self.request.session:
            raise PermissionDenied  # HTTP 403
        context = super(DonateTimeView, self).get_context_data(**kwargs)
        context['donateTime'] = DonateTimeForm(auto_id=False)
        context['member'] = self.user.db_member
        context['connected'] = 'email' in self.request.session
        return context
{'fraction_non_alphanumeric': 0.09835315645013723, 'fraction_numerical': 0.008234217749313814, 'mean_word_length': 3.703225806451613, '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': '5317932', 'n_tokens_mistral': 643, 'n_tokens_neox': 617, 'n_words': 141}