Require being logged in to edit a lesson
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 29 May 2014 13:28:26 +0000 (15:28 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 12 Aug 2014 09:47:15 +0000 (11:47 +0200)
apps/wiki/views.py

index 827a483..d776302 100644 (file)
@@ -15,6 +15,7 @@ from django.utils.translation import ugettext as _
 from django.views.decorators.http import require_POST, require_GET
 from django.shortcuts import get_object_or_404, render
 from django.utils import simplejson
 from django.views.decorators.http import require_POST, require_GET
 from django.shortcuts import get_object_or_404, render
 from django.utils import simplejson
+from django.contrib.auth.decorators import login_required
 
 from catalogue.models import Book, Chunk, Template
 import nice_diff
 
 from catalogue.models import Book, Chunk, Template
 import nice_diff
@@ -51,6 +52,7 @@ def get_history(chunk):
 
 
 @never_cache
 
 
 @never_cache
+@login_required
 def editor(request, slug, chunk=None, template_name='wiki/bootstrap.html'):
     try:
         chunk = Chunk.get(slug, chunk)
 def editor(request, slug, chunk=None, template_name='wiki/bootstrap.html'):
     try:
         chunk = Chunk.get(slug, chunk)