Permalink
Browse files

Add @login_required to all views

  • Loading branch information...
1 parent 5d333e9 commit 95f573c56f4fc896e3c46aad03aa4b9d688570e0 @mdiep committed Aug 20, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 poplar/views.py
View
@@ -2,32 +2,38 @@
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
-from django.contrib.sites.models import get_current_site
+from django.contrib.auth.decorators import login_required
+from django.contrib.sites.models import get_current_site
from poplar.models import Person, Group
+@login_required
def activity_feed(request):
groups = Group.objects.all()
site = get_current_site(request)
return render_to_response('poplar/activity_feed.html', locals(),
context_instance=RequestContext(request))
+@login_required
def everyone(request):
return person_list(request, people=Person.objects.all(), title='Everyone')
+@login_required
def person(request, id):
person = get_object_or_404(Person, id=id)
groups = Group.objects.all()
site = get_current_site(request)
return render_to_response('poplar/person.html', locals(),
context_instance=RequestContext(request))
+@login_required
def person_list(request, people, title):
groups = Group.objects.all()
site = get_current_site(request)
return render_to_response('poplar/person_list.html', locals(),
context_instance=RequestContext(request))
+@login_required
def group(request, slug):
group = get_object_or_404(Group, slug=slug)
return person_list(request, people=group.people.all(), title=group.name)

0 comments on commit 95f573c

Please sign in to comment.