def post_save_resource(instance, sender, **kwargs):
 current_site = Site.objects.get_current()
 master_site = Site.objects.get(id=1)
 SiteResources.objects.get(site=current_site).resources.add(instance.get_self_resource())
 SiteResources.objects.get(site=master_site).resources.add(instance.get_self_resource())

def post_save_resource ( instance , sender , ** kwargs ) : current_site = Site . objects . get_current ( ) master_site = Site . objects . get ( id = 1 ) SiteResources . objects . get ( site = current_site ) . resources . add ( instance . get_self_resource ( ) ) SiteResources . objects . get ( site = master_site ) . resources . add ( instance . get_self_resource ( ) )
signal to ensure that every created resource is assigned to the current site and to the master site .