mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
request.user.is_authenticated() substitued for @login_required decorator
settings.LOGIN_URL = /accounts/login
This commit is contained in:
parent
ae4fdcec92
commit
dac974ddab
10 changed files with 33 additions and 61 deletions
|
|
@ -1,21 +1,20 @@
|
|||
from django.shortcuts import render, get_object_or_404
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from computes.models import Compute
|
||||
from interfaces.forms import AddInterface
|
||||
from vrtManager.interface import wvmInterface, wvmInterfaces
|
||||
from libvirt import libvirtError
|
||||
|
||||
|
||||
@login_required
|
||||
def interfaces(request, compute_id):
|
||||
"""
|
||||
:param request:
|
||||
:return:
|
||||
"""
|
||||
|
||||
if not request.user.is_authenticated():
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
if not request.user.is_superuser:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
|
|
@ -57,15 +56,13 @@ def interfaces(request, compute_id):
|
|||
return render(request, 'interfaces.html', locals())
|
||||
|
||||
|
||||
@login_required
|
||||
def interface(request, compute_id, iface):
|
||||
"""
|
||||
:param request:
|
||||
:return:
|
||||
"""
|
||||
|
||||
if not request.user.is_authenticated():
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
if not request.user.is_superuser:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue