@cronjobs.register
def exclude_new_region(regions):
 region_ids = [r.id for r in regions]
 excluded = set(AddonExcludedRegion.objects.filter(region__in=region_ids).values_list('addon', flat=True))
 ids = Webapp.objects.exclude(id__in=excluded).filter(enable_new_regions=False).values_list('id', flat=True)
 _region_exclude(ids, region_ids)

@ cronjobs . register def exclude_new_region ( regions ) : region_ids = [ r . id for r in regions ] excluded = set ( AddonExcludedRegion . objects . filter ( region__in = region_ids ) . values_list ( 'addon' , flat = True ) ) ids = Webapp . objects . exclude ( id__in = excluded ) . filter ( enable_new_regions = False ) . values_list ( 'id' , flat = True ) _region_exclude ( ids , region_ids )
update blocked regions based on a list of regions to exclude .