blob: 0f772cbd99e1c9e9b002ab9a032dcf97de7a63d5 [file] [log] [blame]
def handle(slice_privilege):
from core.models import Controller, SlicePrivilege, ControllerSlicePrivilege
# apply slice privilage at all controllers
controller_slice_privileges = ControllerSlicePrivilege.objects.filter(
slice_privilege = slice_privilege,
)
existing_controllers = [csp.controller for sp in controller_slice_privileges]
all_controllers = Controller.objects.all()
for controller in all_controllers:
if controller not in existing_controllers:
ctrl_slice_priv = ControllerSlicePrivilege(controller=controller, slice_privilege=slice_privilege)
ctrl_slice_priv.save()