From f6f7c195691a9623c64b251a053b02b0cd77c0b5 Mon Sep 17 00:00:00 2001 From: James Turk Date: Tue, 29 May 2012 00:19:20 -0400 Subject: [PATCH] require login --- fowl/game/views.py | 5 +++++ fowl/urls.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fowl/game/views.py b/fowl/game/views.py index 6dabbcf..98a70a9 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -1,10 +1,12 @@ from itertools import izip_longest from collections import defaultdict 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, OUTCOMES, TITLES) +@login_required def events(request, league_id): league = get_object_or_404(League, pk = league_id) leagues = League.objects.all() @@ -26,6 +28,7 @@ def events(request, league_id): 'leagues':leagues}) +@login_required def edit_event(request, event): if event == 'new': event = None @@ -76,6 +79,8 @@ def edit_event(request, event): 'TITLES': TITLES} ) + +@login_required def league(request, league_id): league = get_object_or_404(League, pk = league_id) leagues = League.objects.all() diff --git a/fowl/urls.py b/fowl/urls.py index bcc11eb..a96a1a1 100644 --- a/fowl/urls.py +++ b/fowl/urls.py @@ -5,6 +5,6 @@ admin.autodiscover() urlpatterns = patterns('', url(r'^', include('fowl.game.urls')), - + url(r'^accounts/login/$', 'django.contrib.auth.views.login'), url(r'^admin/', include(admin.site.urls)), )