import iris.views
from teams.models import Team


def activity(request, slug, *args, **kw):
    template_name = 'teams/activity.html'
    team = get_object_or_404(Team, slug=slug)
    template_context = {
        'group': team,
    }
    return render_to_response(template_name, template_context, RequestContext(request))


def topics_with_team_slug(*args, **kwargs):
    # Insert the team into the template context as 'group' so that
    # breadcrumbs, etc. render properly.
    slug = kwargs['slug']
    extra_context = kwargs.setdefault('extra_context', {})
    extra_context['group'] = Team.objects.get(slug=slug)
    return iris.views.topics(*args, **kwargs)

from django.shortcuts import get_object_or_404, render_to_response
from django.template.context import RequestContext

import iris.views
from teams.models import Team


def activity(request, slug, *args, **kw):
    template_name = 'teams/activity.html'
    team = get_object_or_404(Team, slug=slug)
    template_context = {
        'group': team,
    }
    return render_to_response(template_name, template_context, RequestContext(request))


def topics_with_team_slug(*args, **kwargs):
    # Insert the team into the template context as 'group' so that
    # breadcrumbs, etc. render properly.
    slug = kwargs['slug']
    extra_context = kwargs.setdefault('extra_context', {})
    extra_context['group'] = Team.objects.get(slug=slug)
    return iris.views.topics(*args, **kwargs)

Fix team activity history view (was missing imports)
Fix team activity history view (was missing imports)

+ from django.shortcuts import get_object_or_404, render_to_response
+ from django.template.context import RequestContext
+ 
  import iris.views
  from teams.models import Team
  
  
  def activity(request, slug, *args, **kw):
      template_name = 'teams/activity.html'
      team = get_object_or_404(Team, slug=slug)
      template_context = {
          'group': team,
      }
      return render_to_response(template_name, template_context, RequestContext(request))
  
  
  def topics_with_team_slug(*args, **kwargs):
      # Insert the team into the template context as 'group' so that
      # breadcrumbs, etc. render properly.
      slug = kwargs['slug']
      extra_context = kwargs.setdefault('extra_context', {})
      extra_context['group'] = Team.objects.get(slug=slug)
      return iris.views.topics(*args, **kwargs)
  
Fix team activity history view (was missing imports)
## Code Before:
import iris.views
from teams.models import Team


def activity(request, slug, *args, **kw):
    template_name = 'teams/activity.html'
    team = get_object_or_404(Team, slug=slug)
    template_context = {
        'group': team,
    }
    return render_to_response(template_name, template_context, RequestContext(request))


def topics_with_team_slug(*args, **kwargs):
    # Insert the team into the template context as 'group' so that
    # breadcrumbs, etc. render properly.
    slug = kwargs['slug']
    extra_context = kwargs.setdefault('extra_context', {})
    extra_context['group'] = Team.objects.get(slug=slug)
    return iris.views.topics(*args, **kwargs)

## Instruction:
Fix team activity history view (was missing imports)
## Code After:
from django.shortcuts import get_object_or_404, render_to_response
from django.template.context import RequestContext

import iris.views
from teams.models import Team


def activity(request, slug, *args, **kw):
    template_name = 'teams/activity.html'
    team = get_object_or_404(Team, slug=slug)
    template_context = {
        'group': team,
    }
    return render_to_response(template_name, template_context, RequestContext(request))


def topics_with_team_slug(*args, **kwargs):
    # Insert the team into the template context as 'group' so that
    # breadcrumbs, etc. render properly.
    slug = kwargs['slug']
    extra_context = kwargs.setdefault('extra_context', {})
    extra_context['group'] = Team.objects.get(slug=slug)
    return iris.views.topics(*args, **kwargs)
