diff --git a/fowl/game/views.py b/fowl/game/views.py index 98a70a9..3239c02 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -9,7 +9,7 @@ from fowl.game.models import (Team, TeamPoints, Star, Event, League, @login_required def events(request, league_id): league = get_object_or_404(League, pk = league_id) - leagues = League.objects.all() + leagues = League.objects.filter(teams__login=request.user) events = {} points = TeamPoints.objects.filter(team__league_id=league_id).order_by( 'match__id', 'team').select_related() @@ -83,7 +83,7 @@ def edit_event(request, event): @login_required def league(request, league_id): league = get_object_or_404(League, pk = league_id) - leagues = League.objects.all() + leagues = League.objects.filter(teams__login=request.user) context = { 'view': 'league', 'belts': ['ic', 'us', 'heavyweight', 'wwe'], @@ -99,7 +99,7 @@ def league(request, league_id): def roster(request, league_id): league = get_object_or_404(League, pk = league_id) - leagues = League.objects.all() + leagues = League.objects.filter(teams__login=request.user) context = { 'stars': Star.objects.all(), 'view': 'roster', diff --git a/makedb.sh b/makedb.sh deleted file mode 100755 index 08b685f..0000000 --- a/makedb.sh +++ /dev/null @@ -1,4 +0,0 @@ -rm fowl.db -./manage.py syncdb -./manage.py loaddata testdata -echo "%run setup_league.py" | ./manage.py shell