From 2984c52e602c1ced45bc4172182d826c64ef1240 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 8 Feb 2008 21:02:26 +0100 Subject: [PATCH] * Add login_required decorator to some views. --- influences/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/influences/views.py b/influences/views.py index 1c0f648..6c48653 100644 --- a/influences/views.py +++ b/influences/views.py @@ -1,3 +1,4 @@ +from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.shortcuts import get_object_or_404 from django.template import RequestContext @@ -21,6 +22,7 @@ class CharacterForm(ContextModelForm): model = Character fields = ('name') +@login_required def add(request, character_id=None): initial = {} # Get the current user's characters @@ -41,6 +43,7 @@ def add(request, character_id=None): return render_to_response('influences/add.html', {'form' : f}, RequestContext(request)) +@login_required def addCharacter(request): f = CharacterForm(request=request) if (f.is_valid()): @@ -51,6 +54,7 @@ def addCharacter(request): return render_to_response('influences/add_character.html', {'form' : f}, RequestContext(request)) +@login_required def index(request): characters = request.user.character_set.all() influences = Influence.objects.filter(character__in=characters) -- 2.30.2