fix bugs where ask_ var was checked on node

This commit is contained in:
AlanCoding 2017-12-08 13:57:33 -05:00
parent e59a724efa
commit 905ff7dad7
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B

View File

@ -627,7 +627,7 @@ class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
ask_field_name = ask_mapping[self.relationship]
if not getattr(parent, ask_field_name):
if not getattr(parent.unified_job_template, ask_field_name):
return {"msg": _("Related template is not configured to accept credentials on launch.")}
elif sub.unique_hash() in [cred.unique_hash() for cred in parent.credentials.all()]:
return {"msg": _("This launch configuration already provides a {credential_type} credential.").format(