view and url from team detail page
This commit is contained in:
parent
a907b78bd1
commit
86a346f628
2 changed files with 22 additions and 0 deletions
6
symposion/teams/urls.py
Normal file
6
symposion/teams/urls.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
from django.conf.urls.defaults import *
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = patterns("symposion.teams.views",
|
||||||
|
url(r"^(\w+)/$", "team_detail", name="team_detail"),
|
||||||
|
)
|
16
symposion/teams/views.py
Normal file
16
symposion/teams/views.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
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", {
|
||||||
|
})
|
Loading…
Reference in a new issue