Use django's login_required decorator

This only seems to be here to have some custom login_url used bypassing
django's model.  Well as we want to use django's model, this just won't
do.  So lets move to using django's model.
This commit is contained in:
Sachi King 2017-03-26 11:50:10 +11:00
parent a8a5d3b5e8
commit d5986de870
8 changed files with 8 additions and 15 deletions

View file

@ -1,10 +1,9 @@
from django.http import Http404
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from account.decorators import login_required
@login_required
def user_list(request):

View file

@ -4,6 +4,7 @@ import random
import sys
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db.models import Q
@ -16,7 +17,6 @@ from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from account.decorators import login_required
from account.models import EmailAddress
from symposion.proposals.models import (

View file

@ -2,6 +2,7 @@ import csv
import random
import StringIO
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mass_mail
from django.db.models import Q
from django.http import HttpResponse
@ -10,8 +11,6 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.template import Context, Template
from django.views.decorators.http import require_POST
from account.decorators import login_required
# @@@ switch to pinax-teams
from symposion.teams.models import Team

View file

@ -14,7 +14,7 @@ from django.contrib.sites.models import Site
from django_ical.views import ICalFeed
from account.decorators import login_required
from django.contrib.auth.decorators import login_required
from symposion.schedule.forms import SlotEditForm, ScheduleSectionForm
from symposion.schedule.models import Schedule, Day, Slot, Presentation, Session, SessionRole

View file

@ -4,11 +4,10 @@ from django.http import Http404
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from account.decorators import login_required
from symposion.proposals.models import ProposalBase
from symposion.speakers.forms import SpeakerForm
from symposion.speakers.models import Speaker

View file

@ -13,13 +13,12 @@ from zipfile import ZipFile, ZipInfo
from django.conf import settings
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from account.decorators import login_required
from symposion.sponsorship.forms import SponsorApplicationForm, \
SponsorDetailsForm, SponsorBenefitsFormSet
from symposion.sponsorship.models import Benefit, Sponsor, SponsorBenefit, \

View file

@ -3,10 +3,9 @@ from django.http import Http404, HttpResponseNotAllowed
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
from account.decorators import login_required
from symposion.utils.mail import send_email
from symposion.teams.forms import TeamInvitationForm
from symposion.teams.models import Team, Membership

View file

@ -1,11 +1,9 @@
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from account.decorators import login_required
@login_required
def dashboard(request):
if request.session.get("pending-token"):