summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/views.py6
-rw-r--r--packages/views.py2
-rw-r--r--settings.py1
-rw-r--r--todolists/views.py6
-rw-r--r--wiki/views.py5
5 files changed, 2 insertions, 18 deletions
diff --git a/devel/views.py b/devel/views.py
index 539309b4..18888f0a 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -1,5 +1,4 @@
from django.http import HttpResponse, HttpResponseRedirect
-from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core import validators
from archweb_dev.main.utils import render_response, validate
@@ -9,8 +8,6 @@ from archweb_dev.main.models import UserProfile, News, Donor, Mirror
from django.http import HttpResponse
from django.template import Context, loader
-
-@login_required
def index(request):
try:
thismaint = User.objects.get(username=request.user.username)
@@ -54,7 +51,6 @@ def index(request):
{'stats': stats, 'pkgs': pkgs, 'todos': todos, 'maint': thismaint,
'repos': repo_stats, 'arches': arch_stats})
-@login_required
#@is_maintainer
def change_notify(request):
maint = User.objects.get(username=request.user.username)
@@ -66,7 +62,6 @@ def change_notify(request):
maint.get_profile().save()
return HttpResponseRedirect('/devel/')
-@login_required
def change_profile(request):
errors = {}
if request.POST:
@@ -85,7 +80,6 @@ def change_profile(request):
return HttpResponseRedirect('/devel/')
return render_response(request, 'devel/profile.html', {'errors':errors,'email':request.user.email})
-@login_required
def guide(request):
t = loader.get_template('devel/pkgmaint_guide.txt')
c = Context()
diff --git a/packages/views.py b/packages/views.py
index fc19e444..87d61f93 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -3,7 +3,6 @@ from django.shortcuts import get_object_or_404
from django.core.mail import send_mail
from django.template import Context, loader
from django.core import validators
-from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from datetime import datetime
from archweb_dev.main.utils import validate, render_response
@@ -174,7 +173,6 @@ def flag(request, pkgid):
fail_silently=True)
return render_response(request, 'packages/flag.html', context)
-@login_required
def unflag(request, pkgid):
pkg = get_object_or_404(Package, id=pkgid)
pkg.needupdate = 0
diff --git a/settings.py b/settings.py
index fc5f6e38..96084914 100644
--- a/settings.py
+++ b/settings.py
@@ -55,6 +55,7 @@ if CACHE == True:
MIDDLEWARE_CLASSES += (
"django.middleware.common.CommonMiddleware",
"django.middleware.doc.XViewMiddleware",
+ "main.middleware.RequireLoginMiddleware",
)
ROOT_URLCONF = 'archweb_dev.urls'
diff --git a/todolists/views.py b/todolists/views.py
index fe8b1d42..3a96dc87 100644
--- a/todolists/views.py
+++ b/todolists/views.py
@@ -1,6 +1,6 @@
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404
-from django.contrib.auth.decorators import login_required, user_passes_test
+from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth.models import User
from archweb_dev.main.utils import render_response
from archweb_dev.main.models import Todolist, TodolistPkg, Package
@@ -10,7 +10,6 @@ from archweb_dev.main.models import Arch, Repo
import django.db
IntegrityError = django.db.backend.Database.IntegrityError
-@login_required
def flag(request, listid, pkgid):
list = get_object_or_404(Todolist, id=listid)
pkg = get_object_or_404(TodolistPkg, id=pkgid)
@@ -18,7 +17,6 @@ def flag(request, listid, pkgid):
pkg.save()
return HttpResponseRedirect('/todo/%s/' % (listid))
-@login_required
def view(request, listid):
list = get_object_or_404(Todolist, id=listid)
pkgs = TodolistPkg.objects.filter(list=list.id).order_by('pkg')
@@ -27,7 +25,6 @@ def view(request, listid):
'todolists/view.html',
{'list':list,'pkgs':pkgs})
-@login_required
def list(request):
lists = Todolist.objects.order_by('-date_added')
for l in lists:
@@ -35,7 +32,6 @@ def list(request):
list=l.id,complete=False).count() == 0
return render_response(request, 'todolists/list.html', {'lists':lists})
-@login_required
@user_passes_test(lambda u: u.has_perm('todolists.add_todolist'))
def add(request):
if request.POST:
diff --git a/wiki/views.py b/wiki/views.py
index 4c9f732f..90378346 100644
--- a/wiki/views.py
+++ b/wiki/views.py
@@ -2,11 +2,9 @@
# Based on code from http://e-scribe.com/news/210
#
from django.http import HttpResponse, HttpResponseRedirect
-from django.contrib.auth.decorators import login_required
from archweb_dev.main.utils import render_response
from archweb_dev.main.models import Wikipage
-@login_required
def index(request):
"""Return a list of all wiki pages"""
pages = Wikipage.objects.all().order_by('title')
@@ -16,7 +14,6 @@ def main(request):
"""Return the Index wiki page"""
return HttpResponseRedirect("/wiki/WikiIndex/")
-@login_required
def page(request, title):
"""Display page, or redirect to root if page doesn't exist yet"""
try:
@@ -25,7 +22,6 @@ def page(request, title):
except Wikipage.DoesNotExist:
return HttpResponseRedirect("/wiki/edit/%s/" % title)
-@login_required
def edit(request, title):
"""Process submitted page edits (POST) or display editing form (GET)"""
if request.POST:
@@ -48,7 +44,6 @@ def edit(request, title):
page.body = "<!-- Enter content here -->"
return render_response(request, 'wiki/edit.html', {'page':page})
-@login_required
def delete(request):
"""Delete a page"""
if request.POST: