Skip to content

Commit 095fa67

Browse files
authored
Replaced depreciated admin.type with ACLManager
1 parent 9c983fe commit 095fa67

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dockerManager/decorators.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
from django.http import HttpResponse
77
from loginSystem.views import loadLoginPage
88
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
9+
from plogical.acl import ACLManager
910

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

1314
try:
14-
val = request.session['userID']
15+
userID = request.session['userID']
1516
except KeyError:
1617
return redirect(loadLoginPage)
1718

18-
admin = Administrator.objects.get(pk=val)
19+
currentACL = ACLManager.loadedACL(userID)
1920

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

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

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

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

51-
return wrap
52+
return wrap

0 commit comments

Comments
 (0)