<commit_before>from django.shortcuts import get_object_or_404
import jingo

from django.contrib.auth.models import User
from challenges.models import Submission, Category
from projects.models import Project


def splash(request, project, slug, template_name='challenges/show.html'):
    """Show an individual project challenge."""
    project = get_object_or_404(Project, slug=project)
    challenge = get_object_or_404(project.challenge_set, slug=slug)
    entries = (Submission.objects.visible()
                                 .filter(phase__challenge=challenge)
                                 .order_by("?"))
    
    return jingo.render(request, 'ignite/splash.html', {
        'challenge': challenge,
        'project': project,
        'phases': list(enumerate(challenge.phases.all(), start=1)),
        'entries': entries[:10],
        'categories': Category.objects.get_active_categories(),
    })

def judges(request, project, slug, template_name='challenges/all_judges.html'):
    """ List all judges we have in the system """
    profiles = []
    for judge in User.objects.filter(groups__name='Judges'):
        profiles.append(judge.get_profile())

    return jingo.render(request, 'ignite/judges.html', {
        'profiles': profiles
    })<commit_msg>Changing the number of homepage submissions to 3<commit_after>from django.shortcuts import get_object_or_404
import jingo

from django.contrib.auth.models import User
from challenges.models import Submission, Category
from projects.models import Project


def splash(request, project, slug, template_name='challenges/show.html'):
    """Show an individual project challenge."""
    project = get_object_or_404(Project, slug=project)
    challenge = get_object_or_404(project.challenge_set, slug=slug)
    entries = (Submission.objects.visible()
                                 .filter(phase__challenge=challenge)
                                 .order_by("?"))
    
    return jingo.render(request, 'ignite/splash.html', {
        'challenge': challenge,
        'project': project,
        'phases': list(enumerate(challenge.phases.all(), start=1)),
        'entries': entries[:3],
        'categories': Category.objects.get_active_categories(),
    })

def judges(request, project, slug, template_name='challenges/all_judges.html'):
    """ List all judges we have in the system """
    profiles = []
    for judge in User.objects.filter(groups__name='Judges'):
        profiles.append(judge.get_profile())

    return jingo.render(request, 'ignite/judges.html', {
        'profiles': profiles
    })
{'fraction_non_alphanumeric': 0.11810411810411811, 'fraction_numerical': 0.009324009324009324, 'mean_word_length': 3.335016835016835, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1028961', 'n_tokens_mistral': 763, 'n_tokens_neox': 706, 'n_words': 161}