<commit_before>from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext

from models import Event

@staff_member_required
def event_statistics(request, event_id, template_name='admin/events/event/statistics.html'):
    event = get_object_or_404(Event, id=event_id)

    checkedin_precentage = 0
    if event.attendees_count > 0:
        checkedin_precentage = 100 * float(event.checkedin_count) / float(event.attendees_count)

    new = 0
    new_checkedin = 0
    for attendee in event.attendees:
        if attendee.is_new:
            new += 1

            if attendee.has_attended:
                new_checkedin += 1

    new_checkedin_precentage = 0<commit_msg>Rettet fejl i beregning af nye brugere.<commit_after>from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext

from models import Event

@staff_member_required
def event_statistics(request, event_id, template_name='admin/events/event/statistics.html'):
    event = get_object_or_404(Event, id=event_id)

    checkedin_precentage = 0
    if event.attendees_count > 0:
        checkedin_precentage = 100 * float(event.checkedin_count) / float(event.attendees_count)

    new = 0
    new_checkedin = 0
    for attendee in event.attendees:
        if attendee.is_new():
            new += 1

            if attendee.has_attended:
                new_checkedin += 1

    new_checkedin_precentage = 0
{'fraction_non_alphanumeric': 0.06894409937888199, 'fraction_numerical': 0.01987577639751553, 'mean_word_length': 3.6560693641618496, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3934678', 'n_tokens_mistral': 536, 'n_tokens_neox': 494, 'n_words': 109}