* Add login_required decorator to some views.
authorMatthijs Kooijman <matthijs@stdio.flexvps.nl>
Fri, 8 Feb 2008 20:02:26 +0000 (21:02 +0100)
committerMatthijs Kooijman <matthijs@stdio.flexvps.nl>
Fri, 8 Feb 2008 20:02:26 +0000 (21:02 +0100)
influences/views.py

index 1c0f648a2c7c47f21d2fb48309efc3e9ca5a5e46..6c4865340264b5654a64a09d43d537160d7516ba 100644 (file)
@@ -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)