Skip to content
Permalink
Browse files

Replaced depreciated admin.type with ACLManager

  • Loading branch information...
jetchirag committed Feb 3, 2019
1 parent 9c983fe commit 095fa6743b32ee954427a595d12cf43ddff1854c
Showing with 6 additions and 5 deletions.
  1. +6 −5 dockerManager/decorators.py
@@ -6,16 +6,17 @@
from django.http import HttpResponse
from loginSystem.views import loadLoginPage
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
from plogical.acl import ACLManager

def preDockerRun(function):
def wrap(request, *args, **kwargs):

try:
val = request.session['userID']
userID = request.session['userID']
except KeyError:
return redirect(loadLoginPage)

admin = Administrator.objects.get(pk=val)
currentACL = ACLManager.loadedACL(userID)

if request.method == "POST":
isPost = True
@@ -30,7 +31,7 @@ def wrap(request, *args, **kwargs):
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
else:
return render(request, 'dockerManager/install.html', {'status':admin.type, 'conErr':0})
return render(request, 'dockerManager/install.html', {'status':currentACL['admin'], 'conErr':0})

# Check if docker is running and we are able to connect

@@ -44,8 +45,8 @@ def wrap(request, *args, **kwargs):
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
else:
return render(request, 'dockerManager/install.html', {'status':admin.type, 'conErr':1})
return render(request, 'dockerManager/install.html', {'status':currentACL['admin'], 'conErr':1})

return function(request, *args, **kwargs)

return wrap
return wrap

0 comments on commit 095fa67

Please sign in to comment.
You can’t perform that action at this time.