blob: a49c868dc9566001817384c06632aafa0d631a25 [file] [log] [blame]
from core.models import *
def handle(site):
# make sure site has a ControllerSite record for each controller
ctrl_sites = ControllerSite.objects.filter(site=site)
existing_controllers = [cs.controller for cs in ctrl_sites]
all_controllers = Controller.objects.all()
for ctrl in all_controllers:
if ctrl not in existing_controllers:
ctrl_site = ControllerSite(controller=ctrl, site=site)
ctrl_site.save()