symposion_app/symposion/teams/views.py

18 lines
455 B
Python
Raw Normal View History

2012-07-28 22:30:00 +00:00
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()
2012-08-02 01:38:50 +00:00
2012-07-28 22:30:00 +00:00
return render(request, "teams/team_detail.html", {
2012-08-02 01:38:50 +00:00
"team": team,
2012-07-28 22:30:00 +00:00
})