diff options
author | eliott <eliott@cactuswax.net> | 2008-04-10 07:43:07 +0200 |
---|---|---|
committer | eliott <eliott@cactuswax.net> | 2008-04-10 07:43:07 +0200 |
commit | 751ac09698cb58afddb3e726a29438646777e877 (patch) | |
tree | d26e51fa37ca5be6ed85826644f8d87cf2ce51dd | |
parent | ca033e91bf5e6c22369447a0f1c7fdd4e497b736 (diff) | |
download | archweb-751ac09698cb58afddb3e726a29438646777e877.tar.gz archweb-751ac09698cb58afddb3e726a29438646777e877.tar.xz |
Removed login_required from the individual views.
Not entire dev site requires login.
-rw-r--r-- | devel/views.py | 6 | ||||
-rw-r--r-- | packages/views.py | 2 | ||||
-rw-r--r-- | settings.py | 1 | ||||
-rw-r--r-- | todolists/views.py | 6 | ||||
-rw-r--r-- | wiki/views.py | 5 |
5 files changed, 2 insertions, 18 deletions
diff --git a/devel/views.py b/devel/views.py index 539309b..18888f0 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 fc19e44..87d61f9 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 fc5f6e3..9608491 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 fe8b1d4..3a96dc8 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 4c9f732..9037834 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: |