From 8b3e49cb2417a184008198429836ed254d939fd3 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Fri, 19 Oct 2018 12:39:00 -0400 Subject: [PATCH] fix server error using 2 creds of same type --- awx/api/views/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py index 146eff930b..e1af329953 100644 --- a/awx/api/views/__init__.py +++ b/awx/api/views/__init__.py @@ -3172,8 +3172,8 @@ class JobTemplateCredentialsList(SubListCreateAttachDetachAPIView): def is_valid_relation(self, parent, sub, created=False): if sub.unique_hash() in [cred.unique_hash() for cred in parent.credentials.all()]: - return {"error": _("Cannot assign multiple {credential_type} credentials.".format( - credential_type=sub.unique_hash(display=True)))} + return {"error": _("Cannot assign multiple {credential_type} credentials.").format( + credential_type=sub.unique_hash(display=True))} kind = sub.credential_type.kind if kind not in ('ssh', 'vault', 'cloud', 'net'): return {'error': _('Cannot assign a Credential of kind `{}`.').format(kind)}