diff --git a/apps/orgs/models.py b/apps/orgs/models.py index d762e5eba..ac0830592 100644 --- a/apps/orgs/models.py +++ b/apps/orgs/models.py @@ -150,10 +150,7 @@ class Organization(models.Model): @classmethod def get_user_all_orgs(cls, user): - return [ - *cls.objects.filter(members=user).distinct(), - cls.default() - ] + return cls.objects.filter(members=user).distinct() @classmethod def get_user_admin_orgs(cls, user): diff --git a/apps/users/serializers/profile.py b/apps/users/serializers/profile.py index c89b173ff..1c5e99873 100644 --- a/apps/users/serializers/profile.py +++ b/apps/users/serializers/profile.py @@ -15,11 +15,6 @@ class UserOrgSerializer(serializers.Serializer): is_root = serializers.BooleanField(read_only=True) -class UserOrgLabelSerializer(serializers.Serializer): - value = serializers.CharField(source='id') - label = serializers.CharField(source='name') - - class UserUpdatePasswordSerializer(serializers.ModelSerializer): old_password = serializers.CharField(required=True, max_length=128, write_only=True) new_password = serializers.CharField(required=True, max_length=128, write_only=True) @@ -89,7 +84,7 @@ class UserRoleSerializer(serializers.Serializer): class UserProfileSerializer(UserSerializer): admin_or_audit_orgs = UserOrgSerializer(many=True, read_only=True) - user_all_orgs = UserOrgLabelSerializer(many=True, read_only=True) + user_all_orgs = UserOrgSerializer(many=True, read_only=True) current_org_roles = serializers.ListField(read_only=True) public_key_comment = serializers.CharField( source='get_public_key_comment', required=False, read_only=True, max_length=128