def METHOD_NAME(self, org):
    org_id = org.org_id
    try:
        role = self.get(org_id=org_id).role
    except OrgSettings.DoesNotExist:
        return DEFAULT_ORG
    else:
        if role is None:
            return DEFAULT_ORG
        if role in get_available_roles():
            return role
        else:
            logger.warning('Role %s is not valid' % role)
            return DEFAULT_ORG