Allow creating galaxy credential types without an organization (#16077) (#7074)

* remove requirement for galaxy credentials to belong to an organization

* remove organization check for galaxy credential type
This commit is contained in:
Peter Braun 2025-08-28 15:15:36 +02:00 committed by GitHub
parent 36ec5efc88
commit 8b13c75f2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3346,9 +3346,6 @@ class CredentialSerializerCreate(CredentialSerializer):
if attrs.get('team'): if attrs.get('team'):
attrs['organization'] = attrs['team'].organization attrs['organization'] = attrs['team'].organization
if 'credential_type' in attrs and attrs['credential_type'].kind == 'galaxy' and list(owner_fields) != ['organization']:
raise serializers.ValidationError({"organization": _("Galaxy credentials must be owned by an Organization.")})
return super(CredentialSerializerCreate, self).validate(attrs) return super(CredentialSerializerCreate, self).validate(attrs)
def create(self, validated_data): def create(self, validated_data):