mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
use credential property that returns integers
This commit is contained in:
parent
9dbcc5934e
commit
f4f1e0fd3c
@ -2385,14 +2385,14 @@ class JobOptionsSerializer(LabelsListMixin, BaseSerializer):
|
||||
try:
|
||||
if obj.credential:
|
||||
res['credential'] = self.reverse(
|
||||
'api:credential_detail', kwargs={'pk': obj.credential.pk}
|
||||
'api:credential_detail', kwargs={'pk': obj.credential}
|
||||
)
|
||||
except ObjectDoesNotExist:
|
||||
setattr(obj, 'credential', None)
|
||||
try:
|
||||
if obj.vault_credential:
|
||||
res['vault_credential'] = self.reverse(
|
||||
'api:credential_detail', kwargs={'pk': obj.vault_credential.pk}
|
||||
'api:credential_detail', kwargs={'pk': obj.vault_credential}
|
||||
)
|
||||
except ObjectDoesNotExist:
|
||||
setattr(obj, 'vault_credential', None)
|
||||
|
Loading…
Reference in New Issue
Block a user