code: def activate_organizations(self, user):
          
          try:
              relation_name = self.org_model().user_relation_name
          except TypeError:
              # No org_model specified, raises a TypeError because NoneType is
              # not callable. This the most sensible default:
              relation_name = "organizations_organization"
          organization_set = getattr(user, relation_name)
          for org in organization_set.filter(is_active=False):
              org.is_active = True
              org.save()
docs: Activates the related organizations for the user.
  
          It only activates the related organizations by model type - that is, if
          there are multiple types of organizations then only organizations in
          the provided model class are activated.