symposion_app/symposion/teams/views.py
2012-08-01 21:39:00 -04:00

17 lines
455 B
Python

from django.http import Http404
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from symposion.teams.models import Team
@login_required
def team_detail(request, slug):
team = get_object_or_404(Team, slug=slug)
if team.get_state_for_user(request.user) != "manager":
raise Http404()
return render(request, "teams/team_detail.html", {
"team": team,
})