<commit_before>from django.contrib.auth.decorators import login_required
from django.db.models import Count
from django.shortcuts import render, get_object_or_404

from .utils import nopermission

from ..models import Event, Helper


@login_required
def duplicates(request, event_url_name):
    event = get_object_or_404(Event, url_name=event_url_name)

    # check permission
    if not event.is_admin(request.user):
        return nopermission(request)

    duplicates = Helper.objects.values('email', 'firstname', 'surname').annotate(
        email_count=Count('email')).exclude(email_count=1)

    duplicated_helpers = {}

    for dup in duplicates:
        name = "{} {}".format(dup['firstname'], dup['surname'])
        duplicated_helpers[name] = Helper.objects.filter(email=dup['email'])

    # overview over jobs
    context = {'event': event,
               'duplicated_helpers': duplicated_helpers}
    return render(request, 'registration/admin/duplicates.html', context)<commit_msg>maybe bugfix<commit_after>from django.contrib.auth.decorators import login_required
from django.db.models import Count
from django.shortcuts import render, get_object_or_404

from .utils import nopermission

from ..models import Event, Helper


@login_required
def duplicates(request, event_url_name):
    event = get_object_or_404(Event, url_name=event_url_name)

    # check permission
    if not event.is_admin(request.user):
        return nopermission(request)

    duplicates = Helper.objects.values('email').annotate(
        email_count=Count('email')).exclude(email_count=1)

    duplicated_helpers = {}

    for dup in duplicates:
        duplicated_helpers[dup['email']] = Helper.objects.filter(
            email=dup['email'])

    # overview over jobs
    context = {'event': event,
               'duplicated_helpers': duplicated_helpers}
    return render(request, 'registration/admin/duplicates.html', context)
{'fraction_non_alphanumeric': 0.10572916666666667, 'fraction_numerical': 0.007291666666666667, 'mean_word_length': 4.205962059620596, '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': '6865958', 'n_tokens_mistral': 590, 'n_tokens_neox': 560, 'n_words': 122}