@receiver(user_registered)
@receiver(local_site_user_added)
def _add_default_groups(sender, user, local_site=None, **kwargs):
 if local_site:
  default_groups = local_site.groups.filter(is_default_group=True)
 else:
  default_groups = Group.objects.filter(is_default_group=True, local_site=None)
 for default_group in default_groups:
  default_group.users.add(user)

@ receiver ( user_registered ) @ receiver ( local_site_user_added ) def _add_default_groups ( sender , user , local_site = None , ** kwargs ) : if local_site : default_groups = local_site . groups . filter ( is_default_group = True ) else : default_groups = Group . objects . filter ( is_default_group = True , local_site = None ) for default_group in default_groups : default_group . users . add ( user )
add user to default groups .