Merge pull request #5053 from fosterseth/fix-4797-copycredential

Fix secret lookup links when credentials are copied

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-10-23 23:46:52 +00:00 committed by GitHub
commit f1c2a95f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
unique_together = (('organization', 'name', 'credential_type'))
PASSWORD_FIELDS = ['inputs']
FIELDS_TO_PRESERVE_AT_COPY = ['input_sources']
credential_type = models.ForeignKey(
'CredentialType',
@ -1162,6 +1163,8 @@ class CredentialInputSource(PrimordialModel):
unique_together = (('target_credential', 'input_field_name'),)
ordering = ('target_credential', 'source_credential', 'input_field_name',)
FIELDS_TO_PRESERVE_AT_COPY = ['source_credential', 'metadata', 'input_field_name']
target_credential = models.ForeignKey(
'Credential',
related_name='input_sources',