Skip to content
Permalink
Browse files
Update packagesManager.py
  • Loading branch information
humzayunasnandla committed Jun 17, 2020
1 parent 06e1163 commit c7209b52da47a1b0032fb37e7ec2690944dd119d
Showing 1 changed file with 3 additions and 10 deletions.
@@ -246,17 +246,10 @@ def listPackagesAPI(self,data=None):
"""
try:
adminUser = data['adminUser']
adminPass = data['adminPass']
admin = Administrator.objects.get(userName=adminUser)
if hashPassword.check_password(admin.password, adminPass):
currentACL = ACLManager.loadedACL(admin.id)
packageList = ACLManager.loadPackages(admin.id, currentACL)
return HttpResponse(json.dumps(packageList))
else:
data_ret = {"status": 0,
'error_message': "Could not authorize access to API"}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
currentACL = ACLManager.loadedACL(admin.id)
packageList = ACLManager.loadPackages(admin.id, currentACL)
return HttpResponse(json.dumps(packageList);
except BaseException as msg:
data_ret = {'status': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)

0 comments on commit c7209b5

Please sign in to comment.