mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
credential owner fields changed to PK related field to solve 1671
This commit is contained in:
@@ -1554,16 +1554,16 @@ class ResourceAccessListElementSerializer(UserSerializer):
|
|||||||
class CredentialSerializer(BaseSerializer):
|
class CredentialSerializer(BaseSerializer):
|
||||||
|
|
||||||
# FIXME: may want to make some fields filtered based on user accessing
|
# FIXME: may want to make some fields filtered based on user accessing
|
||||||
user = serializers.CharField(
|
user = serializers.PrimaryKeyRelatedField(
|
||||||
required=False, default=None, write_only=True,
|
queryset=User.objects.all(), required=False, default=None, write_only=True,
|
||||||
help_text='Write-only field used to add user to owner role. If provided, '
|
help_text='Write-only field used to add user to owner role. If provided, '
|
||||||
'do not give either team or organization. Only valid for creation.')
|
'do not give either team or organization. Only valid for creation.')
|
||||||
team = serializers.CharField(
|
team = serializers.PrimaryKeyRelatedField(
|
||||||
required=False, default=None, write_only=True,
|
queryset=Team.objects.all(), required=False, default=None, write_only=True,
|
||||||
help_text='Write-only field used to add team to owner role. If provided, '
|
help_text='Write-only field used to add team to owner role. If provided, '
|
||||||
'do not give either user or organization. Only valid for creation.')
|
'do not give either user or organization. Only valid for creation.')
|
||||||
organization = serializers.CharField(
|
organization = serializers.PrimaryKeyRelatedField(
|
||||||
required=False, default=None, write_only=True,
|
queryset=Organization.objects.all(), required=False, default=None, write_only=True,
|
||||||
help_text='Write-only field used to add organization to owner role. If provided, '
|
help_text='Write-only field used to add organization to owner role. If provided, '
|
||||||
'do not give either team or team. Only valid for creation.')
|
'do not give either team or team. Only valid for creation.')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user