From af7c57d9a1abba15644f9c877cb78d4dc5b0dd84 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 22 Dec 2023 12:51:57 +0500 Subject: [PATCH] default package --- websiteFunctions/website.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index ae12287bb..be1810ef9 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -6643,6 +6643,7 @@ def AssignPackage(self, request=None, userID=None, data=None, DeleteID=None): DockerPackagesDelete.delete() except: pass + adminNames = ACLManager.loadAllUsers(userID) dockerpackages = DockerPackages.objects.all() assignpackage = PackageAssignment.objects.all() @@ -6788,9 +6789,13 @@ def AddAssignment(self, userID=None, data=None): package = data['package'] user = data['user'] - docker_package = DockerPackages.objects.get(pk=int(package)) userobj = Administrator.objects.get(userName=user) + delasg = PackageAssignment.objects.get(user=userobj) + delasg.delete() + + docker_package = DockerPackages.objects.get(pk=int(package)) + sv = PackageAssignment(user=userobj, package=docker_package) sv.save()