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
|
@ -2,6 +2,7 @@ import re
|
|||
from django.shortcuts import render
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from instances.models import Instance
|
||||
from vrtManager.instance import wvmInstance
|
||||
from webvirtcloud.settings import WS_PORT
|
||||
|
@ -9,15 +10,13 @@ from webvirtcloud.settings import WS_PUBLIC_HOST
|
|||
from libvirt import libvirtError
|
||||
|
||||
|
||||
@login_required
|
||||
def console(request):
|
||||
"""
|
||||
:param request:
|
||||
:return:
|
||||
"""
|
||||
|
||||
if not request.user.is_authenticated():
|
||||
return HttpResponseRedirect(reverse('login'))
|
||||
|
||||
if request.method == 'GET':
|
||||
token = request.GET.get('token', '')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue