<commit_before>from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseServerError
from django.http.response import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView
from django.views.generic import ListView
from django.views.generic import RedirectView
from django.conf import settings

from performers.models import Performer


def performer_detail_view_add_slug(request, pk=None):
    p = get_object_or_404(Performer, id=pk)
    return HttpResponseRedirect(p.url)


class PerformersRedirectView(RedirectView):
    def get_redirect_url(self):
        return reverse('performers:performers_current')


class PerformerDetailView(DetailView):
    template_name = 'performers/../templates/performers/performer_detail.html'
    model = Performer

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)

        context['performer'] = self.object
        return context


class PerformerAllListView(ListView):
    template_name = 'performers/../templates/performers/performer_list.html'
    model = Performer

    filter_criteria = {}
    performer_list_title = 'All Performers'
<commit_msg>Fix template error bug.<commit_after>from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseServerError
from django.http.response import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView
from django.views.generic import ListView
from django.views.generic import RedirectView
from django.conf import settings

from performers.models import Performer


def performer_detail_view_add_slug(request, pk=None):
    p = get_object_or_404(Performer, id=pk)
    return HttpResponseRedirect(p.url)


class PerformersRedirectView(RedirectView):
    def get_redirect_url(self):
        return reverse('performers:performers_current')


class PerformerDetailView(DetailView):
    template_name = 'performers/performer_detail.html'
    model = Performer

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)

        context['performer'] = self.object
        return context


class PerformerAllListView(ListView):
    template_name = 'performers/performer_list.html'
    model = Performer

    filter_criteria = {}
    performer_list_title = 'All Performers'

{'fraction_non_alphanumeric': 0.07153905645784996, 'fraction_numerical': 0.004640371229698376, 'mean_word_length': 4.866213151927438, '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': '4781342', 'n_tokens_mistral': 732, 'n_tokens_neox': 699, 'n_words': 179}