Skip to content

Commit

Permalink
remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Apr 9, 2021
1 parent b6ed8b3 commit a9bc0e9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
8 changes: 0 additions & 8 deletions dockerManager/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,6 @@ def searchImage(self, userID=None, data=None):
def images(self, request=None, userID=None, data=None):
try:
admin = Administrator.objects.get(pk=userID)
if admin.acl.adminStatus != 1:
return ACLManager.loadError()

client = docker.from_env()
dockerAPI = docker.APIClient()
Expand Down Expand Up @@ -768,12 +766,6 @@ def images(self, request=None, userID=None, data=None):

def manageImages(self, request=None, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadError()

client = docker.from_env()
dockerAPI = docker.APIClient()
Expand Down
22 changes: 0 additions & 22 deletions dockerManager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,6 @@ def runContainer(request):
def listContainers(request):
try:
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson()

cm = ContainerManager()
return cm.listContainers(request, userID)
except KeyError:
Expand Down Expand Up @@ -375,13 +368,6 @@ def images(request):
try:

userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson()

cm = ContainerManager()
coreResult = cm.images(request, userID)

Expand All @@ -393,16 +379,8 @@ def images(request):
def manageImages(request):
try:
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson()

cm = ContainerManager()
coreResult = cm.manageImages(request, userID)

return coreResult
except KeyError:
return redirect(loadLoginPage)
Expand Down

0 comments on commit a9bc0e9

Please sign in to comment.