mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-05-27 15:39:39 +00:00
request.user.is_authenticated() substitued for @login_required decorator
settings.LOGIN_URL = /accounts/login
This commit is contained in:
@@ -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', '')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user