require login
This commit is contained in:
parent
f7caaf2450
commit
f6f7c19569
@ -1,10 +1,12 @@
|
|||||||
from itertools import izip_longest
|
from itertools import izip_longest
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
|
from django.contrib.auth.decorators import login_required
|
||||||
from fowl.game.models import (Team, TeamPoints, Star, Event, League,
|
from fowl.game.models import (Team, TeamPoints, Star, Event, League,
|
||||||
OUTCOMES, TITLES)
|
OUTCOMES, TITLES)
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
def events(request, league_id):
|
def events(request, league_id):
|
||||||
league = get_object_or_404(League, pk = league_id)
|
league = get_object_or_404(League, pk = league_id)
|
||||||
leagues = League.objects.all()
|
leagues = League.objects.all()
|
||||||
@ -26,6 +28,7 @@ def events(request, league_id):
|
|||||||
'leagues':leagues})
|
'leagues':leagues})
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
def edit_event(request, event):
|
def edit_event(request, event):
|
||||||
if event == 'new':
|
if event == 'new':
|
||||||
event = None
|
event = None
|
||||||
@ -76,6 +79,8 @@ def edit_event(request, event):
|
|||||||
'TITLES': TITLES}
|
'TITLES': TITLES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
def league(request, league_id):
|
def league(request, league_id):
|
||||||
league = get_object_or_404(League, pk = league_id)
|
league = get_object_or_404(League, pk = league_id)
|
||||||
leagues = League.objects.all()
|
leagues = League.objects.all()
|
||||||
|
@ -5,6 +5,6 @@ admin.autodiscover()
|
|||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
url(r'^', include('fowl.game.urls')),
|
url(r'^', include('fowl.game.urls')),
|
||||||
|
url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
|
||||||
url(r'^admin/', include(admin.site.urls)),
|
url(r'^admin/', include(admin.site.urls)),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user