<commit_before>import json

from django.http import JsonResponse, Http404
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt

from ivreg.models import Voter
from ivreg.forms import RegistrationForm, ValidationForm
from ivreg.services import generate_candidate_codes, generate_ballot_id, generate_request_id


CANDIDATES = [
    'Candidate 1',
    'Candidate 2',
    'Candidate 3',
]


def index(request):
    return render(request, 'index.html')


def registration(request):
    if request.method == "POST":
        if request.content_type == 'application/json':<commit_msg>Remove csrf from registration form<commit_after>import json

from django.http import JsonResponse, Http404
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt

from ivreg.models import Voter
from ivreg.forms import RegistrationForm, ValidationForm
from ivreg.services import generate_candidate_codes, generate_ballot_id, generate_request_id


CANDIDATES = [
    'Candidate 1',
    'Candidate 2',
    'Candidate 3',
]


def index(request):
    return render(request, 'index.html')


@csrf_exempt
def registration(request):
    if request.method == "POST":
        if request.content_type == 'application/json':
{'fraction_non_alphanumeric': 0.0837245696400626, 'fraction_numerical': 0.009389671361502348, 'mean_word_length': 5.033018867924528, 'pattern_counts': {'":': 2, '<': 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': '7340670', 'n_tokens_mistral': 393, 'n_tokens_neox': 371, 'n_words': 106}